Fixed an unassigned pointer causing memory corruption.

This commit is contained in:
Markus Makela 2014-11-06 20:04:18 +02:00
parent 12a83fb742
commit 8cfea996e7

View File

@ -1406,7 +1406,7 @@ void check_drop_tmp_table(
{ {
int tsize = 0, klen = 0,i; int tsize = 0, klen = 0,i;
char** tbl; char** tbl = NULL;
char *hkey,*dbname; char *hkey,*dbname;
MYSQL_session* data; MYSQL_session* data;
@ -1447,7 +1447,9 @@ void check_drop_tmp_table(
free(tbl[i]); free(tbl[i]);
free(hkey); free(hkey);
} }
free(tbl); if(tbl != NULL){
free(tbl);
}
} }
} }
@ -1468,7 +1470,7 @@ skygw_query_type_t is_read_tmp_table(
bool target_tmp_table = false; bool target_tmp_table = false;
int tsize = 0, klen = 0,i; int tsize = 0, klen = 0,i;
char** tbl; char** tbl = NULL;
char *hkey,*dbname; char *hkey,*dbname;
MYSQL_session* data; MYSQL_session* data;
@ -1529,7 +1531,10 @@ skygw_query_type_t is_read_tmp_table(
{ {
free(tbl[i]); free(tbl[i]);
} }
free(tbl);
if(tbl != NULL){
free(tbl);
}
return qtype; return qtype;
} }