]> source.dussan.org Git - rspamd.git/commitdiff
Fix memory leak
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jan 2016 17:18:10 +0000 (17:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jan 2016 17:18:10 +0000 (17:18 +0000)
src/libmime/message.c

index e4658c164fc43f2f8f38ce9d72251117536e75de..f7b76640ab421036973ceb063f7eee26f954d331 100644 (file)
@@ -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);