From c746bf7f8ad0e5874e778a8b8bbd71bd58d79fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 13 Aug 2019 00:43:02 +1000 Subject: [PATCH] Fix invalid free --- lib/MySQL_Session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 97b81bfa2e..ea0d0bf1c2 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -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 *)"@"))) { @@ -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);