From d52a771e5022aa6e6bd1f70e1f10aca07b441ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 6 Nov 2019 12:45:51 +1100 Subject: [PATCH] Fix memory leak when handling SET autocommit --- lib/MySQL_Session.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 4b428ec01..c1df8dd47 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -840,6 +840,7 @@ bool MySQL_Session::handler_SetAutocommit(PtrSize_t *pkt) { autocommit=true; client_myds->myconn->set_autocommit(autocommit); autocommit_on_hostgroup=FindOneActiveTransaction(); + free(_new_pkt.ptr); return false; } else { // as there is no active transaction, we do no need to forward it