commit 5a7a082: [Fix] Plug memory leak by using mempool for a copied address

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Mar 20 12:49:05 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-03-20 12:45:59 +0000
URL: https://github.com/rspamd/rspamd/commit/5a7a082211a952f8ce170d177db848881d994d99 (HEAD -> master)

[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));


More information about the Commits mailing list