From 931580d1ea2ec69042c6a92a8c4d1d79d8603270 Mon Sep 17 00:00:00 2001 From: xiehan <52160700+Barenboim@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:16:47 +0800 Subject: [PATCH] Fix http server module memory leak. (#411) --- src/http/http_task.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http/http_task.cc b/src/http/http_task.cc index 9bf1fff3..139d7318 100644 --- a/src/http/http_task.cc +++ b/src/http/http_task.cc @@ -402,8 +402,6 @@ void HttpServerTask::handle(int state, int error) this->target = this->get_target(); // fill module data from request to series - ModuleSeries *series = new ModuleSeries(this); - http_get_header_module_data(req, this->module_data_); for (auto *module : this->modules_) { @@ -417,6 +415,8 @@ void HttpServerTask::handle(int state, int error) } } + ModuleSeries *series = new ModuleSeries(this); + series->set_module_data(this->mutable_module_data()); series->start(); }