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.
pull/5310/head^2
Rene Cannao 4 months ago
parent bbc04974f1
commit 188aef90fe

@ -7789,7 +7789,7 @@ char* ProxySQL_Admin::load_mcp_query_rules_to_runtime() {
if (success == false) {
if (resultset) {
free(resultset);
delete resultset;
}
}

Loading…
Cancel
Save