]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Plug memory leak by using mempool for a copied address
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 12:45:59 +0000 (12:45 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 12:45:59 +0000 (12:45 +0000)
src/libmime/received.cxx

index 0886d6e37a9d9f139229d0e53547dec04dc2bdec..82ec2dac033becd0a0bf2eb2acdb58150916787e 100644 (file)
@@ -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));