[MDEV-16658] Memory leak in mysqltest on connect failure Created: 2018-07-02 Updated: 2019-01-24 Resolved: 2019-01-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients, Tests |
| Affects Version/s: | 10.3.7 |
| Fix Version/s: | 10.1.38, 5.5.63, 10.0.38, 10.2.22, 10.3.13 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In such cased mysql_close() is not called while it should. That results in a test failures under clang + ASAN/LSAN. F.ex. main.connect is affected. |
| Comments |
| Comment by Eugene Kosov (Inactive) [ 2018-07-02 ] |
|
I fix this in 10.3 because I suspect only I'm affected by this bug. Should it be fixed in earlier versions too? |
| Comment by Sergei Golubchik [ 2018-07-02 ] |
|
Let's decide that after the review. and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c |
| Comment by Eugene Kosov (Inactive) [ 2018-07-03 ] |
|
> And no, you're not the only one affected Fine. That means patch is more useful than I've thought > and I wouldn't call it a bug, I think it was a conscious design decision to exit() from just anywhere in mysqltest.c Ok. But I do not understand how it's related to this issues case. |
| Comment by Sergei Golubchik [ 2019-01-23 ] |
|
I'd rather move mysql_close() to the caller. Because it's the caller that allocates memory, so it's the caller that should free it. |
| Comment by Eugene Kosov (Inactive) [ 2019-01-24 ] |
|
Looks like I'm too late to improve patch. Thanks for the review! |