]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Plug utexts leak
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Sep 2018 17:16:30 +0000 (18:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Sep 2018 17:16:30 +0000 (18:16 +0100)
src/libmime/message.c
src/plugins/chartable.c

index 0d4581ad7bd65d747b3556d5a9564258a03df92c..f0a235a4c4880d8677bc95d041fcf86332ec8ac8 100644 (file)
@@ -504,6 +504,11 @@ rspamd_normalize_text_part (struct rspamd_task *task,
                        msg_warn_task ("cannot open text from utf content");
                        /* Probably, should be an assertion */
                }
+               else {
+                       rspamd_mempool_add_destructor (task->task_pool,
+                                       (rspamd_mempool_destruct_t)utext_close,
+                                       &part->utf_stripped_text);
+               }
        }
 
        rspamd_mempool_add_destructor (task->task_pool,
index f917c26c896f408000d63a71bfe254edf26cf844..414647153ce37030f28ad1483a937c404cbea645 100644 (file)
@@ -658,6 +658,8 @@ chartable_symbol_callback (struct rspamd_task *task, void *unused)
                if (words) {
                        g_array_free (words, TRUE);
                }
+
+               utext_close (&utxt);
        }
 }