mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #9175 seg fault on 'mysqldump --single-transaction --tab mysql nonexistent'
mysqldump.c: Fixed get_actual_table_name so that it calls mysql_free_result in all cases that a non-NULl result is returned
This commit is contained in:
@ -2120,6 +2120,7 @@ static int get_actual_table_name(const char *old_table_name,
|
||||
char *new_table_name,
|
||||
int buf_size)
|
||||
{
|
||||
int retval;
|
||||
MYSQL_RES *tableRes;
|
||||
MYSQL_ROW row;
|
||||
char query[50 + 2*NAME_LEN];
|
||||
@ -2137,6 +2138,7 @@ static int get_actual_table_name(const char *old_table_name,
|
||||
}
|
||||
|
||||
tableRes= mysql_store_result( sock );
|
||||
retval = 1;
|
||||
if (tableRes != NULL)
|
||||
{
|
||||
my_ulonglong numRows = mysql_num_rows(tableRes);
|
||||
@ -2144,12 +2146,11 @@ static int get_actual_table_name(const char *old_table_name,
|
||||
{
|
||||
row= mysql_fetch_row( tableRes );
|
||||
strmake(new_table_name, row[0], buf_size-1);
|
||||
return 0;
|
||||
retval = 0;
|
||||
}
|
||||
mysql_free_result(tableRes);
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user