From 59889bfc11fc176bf82743fbeeedd258ff94f563 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 30 Sep 2016 15:27:08 +0100 Subject: [PATCH] [Fix] Another memory leak plugged --- src/libserver/protocol.c | 2 +- src/libserver/task.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 3ec4c7eca..95490ea4c 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -363,7 +363,7 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, if (addr) { if (task->rcpt_envelope == NULL) { - task->rcpt_envelope = g_ptr_array_new (); + task->rcpt_envelope = g_ptr_array_sized_new (2); } g_ptr_array_add (task->rcpt_envelope, addr); diff --git a/src/libserver/task.c b/src/libserver/task.c index e6cede086..6b92593de 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -225,6 +225,8 @@ rspamd_task_free (struct rspamd_task *task) addr = g_ptr_array_index (task->rcpt_envelope, i); rspamd_email_address_unref (addr); } + + g_ptr_array_free (task->rcpt_envelope, TRUE); } if (task->from_envelope) { -- 2.39.5