mysqldump get_view_structure does not free MYSQL_RES in one error path
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Fix Released
|
Low
|
Laurynas Biveinis | |||
5.6 |
Fix Released
|
Low
|
Laurynas Biveinis | |||
5.7 |
Fix Released
|
Low
|
Laurynas Biveinis |
Bug Description
Copy of http://
[3 Jun 14:14] Laurynas Biveinis
Description:
A minor code review bug, credit to my colleague Yura Sorokin:
static my_bool get_view_
{
MYSQL_RES *table_res;
...
if (mysql_
...
if (path)
{
if (!(sql_file= open_sql_
DBUG_
Thus, mysql_free_result is not called here.
How to repeat:
Code review
Suggested fix:
For 5.7, call mysql_free_result there.
For lower versions, backport [1], and call mysql_free_result there.
[1]:
commit 353dbcee4a27b8c
Author: Jon Olav Hauglid <email address hidden>
Date: Fri Jun 12 14:55:35 2015 +0200
Bug#21246627: ASAN: MEMORY LEAK IN PROCESS_
Bug#21250584: ASAN: MEMORY LEAK IN MYSQLDUMP
Fix three different memory leaks in mysqldump:
1) Remember to call dynstr_free() on DYNAMIC_STRING.
2) Remember to call mysql_free_result() on MYSQL_RES.
3) Remember to call my_free() on string allocated by alloc_query_str().
tags: | added: upstream |
https:/ /github. com/percona/ percona- server/ pull/569, https:/ /github. com/percona/ percona- server/ pull/570, https:/ /github. com/percona/ percona- server/ pull/571