From dbd123b42751f998096d0121f2079f97236c1a55 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jan 2016 17:18:10 +0000 Subject: [PATCH] Fix memory leak --- src/libmime/message.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libmime/message.c b/src/libmime/message.c index e4658c164..f7b76640a 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1192,6 +1192,13 @@ process_text_part (struct rspamd_task *task, text_part->flags |= RSPAMD_MIME_PART_FLAG_EMPTY; } + /* Handle offsets of this part */ + if (text_part->urls_offset != NULL) { + text_part->urls_offset = g_list_reverse (text_part->urls_offset); + rspamd_mempool_add_destructor (task->task_pool, + (rspamd_mempool_destruct_t) g_list_free, text_part->urls_offset); + } + rspamd_mempool_add_destructor (task->task_pool, (rspamd_mempool_destruct_t) free_byte_array_callback, text_part->content); -- 2.39.5