[MDEV-7095] Memory leak in sql_prepare.cc: Prepared_statement::execute_server_runnable() Created: 2014-11-12 Updated: 2022-11-09 Resolved: 2022-11-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.0 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Minli Zhu | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Memory leak at sql_prepare.cc: The memory was leaked because thd->lex was restored at the end of the function. The fix is that the lex allocated in this function should delete its explain before the function returns, i.e. Lex's "explain" query statement has to be deleted before restoring saved variables to thd to avoid memory leak. Code diff:
|
| Comments |
| Comment by Sergei Golubchik [ 2014-11-14 ] |
|
Interesting. How did you manage to trigger that? As far as I can see this is dead code, it is never executed. |
| Comment by Minli Zhu [ 2014-11-14 ] |
|
It is triggered by calling Ed_connection::execute_direct() from our own code. |
| Comment by Sergei Golubchik [ 2022-11-09 ] |
|
It was dead code. Now we have a service API for executing SQL statements from inside the server, please, use that |