From 188aef90febce56cd547f0e3d457fffc89de9350 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Wed, 21 Jan 2026 23:59:29 +0000 Subject: [PATCH] fix: Use delete instead of free for SQLite3_result in load_mcp_query_rules_to_runtime Change free(resultset) to delete resultset in ProxySQL_Admin::load_mcp_query_rules_to_runtime. SQLite3_result is a C++ class allocated with new, so it must be deallocated with delete, not free(). Using free() causes undefined behavior and memory leaks. Addresses coderabbitai review comment. --- lib/ProxySQL_Admin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 2de36105c..a9f45f0ad 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -7789,7 +7789,7 @@ char* ProxySQL_Admin::load_mcp_query_rules_to_runtime() { if (success == false) { if (resultset) { - free(resultset); + delete resultset; } }