diff options
author | unknown <reggie@mdk10.(none)> | 2005-03-31 08:37:18 -0600 |
---|---|---|
committer | unknown <reggie@mdk10.(none)> | 2005-03-31 08:37:18 -0600 |
commit | 5b3549e64c9b0bce76af0cd16364b998b267674f (patch) | |
tree | 395f0831598e7c5edf6cc43ea5f81b5a14613fc3 /client | |
parent | 633207b549cfe95ad12604894324c831ff2e0f22 (diff) | |
download | mariadb-git-5b3549e64c9b0bce76af0cd16364b998b267674f.tar.gz |
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
client/mysqldump.c:
Fixed get_actual_table_name so that it calls mysql_free_result in all cases that a non-NULl result is returned
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 2a9029244d4..2573c812067 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -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; } |