Skip to content

Commit

Permalink
Fix invalid free
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Aug 12, 2019
1 parent f040ec6 commit c746bf7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4828,6 +4828,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
std::size_t found_at = value1.find("@");
if (found_at != std::string::npos) {
char *v1 = strdup(value1.c_str());
char *v1t = v1;
proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 5, "Found @ in SQL_MODE . v1 = %s\n", v1);
char *v2 = NULL;
while (v1 && (v2 = strstr(v1,(const char *)"@"))) {
Expand All @@ -4846,7 +4847,7 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
v1 = v2+1;
}
}
free(v1);
free(v1t);
}
proxy_debug(PROXY_DEBUG_MYSQL_COM, 5, "Processing SET SQL Mode value %s\n", value1.c_str());
uint32_t sql_mode_int=SpookyHash::Hash32(value1.c_str(),value1.length(),10);
Expand Down

0 comments on commit c746bf7

Please sign in to comment.