From 05aa7d2cc457b6b0a4bd556ef389ff30b3e75251 Mon Sep 17 00:00:00 2001 From: YunShu Date: Wed, 13 Sep 2023 15:04:24 +0800 Subject: [PATCH] fix: delete sql_event after use (#261) ### What problem were solved in this pull request? Problem: memory leak --------- Co-authored-by: wangyunlai --- src/observer/session/session_stage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/observer/session/session_stage.cpp b/src/observer/session/session_stage.cpp index 849830e..49a7ece 100644 --- a/src/observer/session/session_stage.cpp +++ b/src/observer/session/session_stage.cpp @@ -100,8 +100,8 @@ void SessionStage::handle_request(StageEvent *event) Session::set_current_session(sev->session()); sev->session()->set_current_request(sev); - SQLStageEvent *sql_event = new SQLStageEvent(sev, sql); - (void)handle_sql(sql_event); + SQLStageEvent sql_event(sev, sql); + (void)handle_sql(&sql_event); Communicator *communicator = sev->get_communicator(); bool need_disconnect = false; -- GitLab