From 5a7a082211a952f8ce170d177db848881d994d99 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 20 Mar 2022 12:45:59 +0000 Subject: [PATCH] [Fix] Plug memory leak by using mempool for a copied address --- src/libmime/received.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libmime/received.cxx b/src/libmime/received.cxx index 0886d6e37..82ec2dac0 100644 --- a/src/libmime/received.cxx +++ b/src/libmime/received.cxx @@ -737,7 +737,8 @@ received_maybe_fix_task(struct rspamd_task *task) -> bool if (mta_name) { trecv.by_hostname.assign_copy(std::string_view(mta_name)); } - trecv.addr = rspamd_inet_address_copy(task->from_addr, NULL); + trecv.addr = rspamd_inet_address_copy(task->from_addr, + task->task_pool); if (task->hostname) { trecv.real_hostname.assign_copy(std::string_view(task->hostname)); -- 2.39.5