From 65e8caf9b6edab066cec80dc86745f2c80b20c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 14 May 2021 10:07:15 +0200 Subject: [PATCH] Fixed memory corruption due to invalid free of 'qi->stmt_info->query' #3427 --- lib/Query_Processor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Query_Processor.cpp b/lib/Query_Processor.cpp index 63b52a465..734cdb32c 100644 --- a/lib/Query_Processor.cpp +++ b/lib/Query_Processor.cpp @@ -1710,7 +1710,9 @@ __exit_process_mysql_query: if (len < stackbuffer_size) { // query is in the stack } else { - l_free(len+1,query); + if (ptr) { + l_free(len+1,query); + } } if (sess->mirror==false) { // we process comments only on original queries, not on mirrors if (qp && qp->first_comment) {