]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Delay freeing of tokens arrays when classifying
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 31 Mar 2017 16:58:49 +0000 (17:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 31 Mar 2017 16:58:49 +0000 (17:58 +0100)
src/libstat/stat_process.c

index 02425b61582859b2e5be93c216e70ba9fcc909c8..22dcccc99b55c98de59f9803ba6625c22cbf5e4d 100644 (file)
@@ -219,7 +219,8 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx,
                        "META:",
                        task->tokens);
 
-       g_array_free (ar, TRUE);
+       rspamd_mempool_add_destructor (task->task_pool,
+                       rspamd_array_free_hard, ar);
 }
 
 /*
@@ -288,7 +289,9 @@ rspamd_stat_process_tokenize (struct rspamd_stat_ctx *st_ctx,
                                        TRUE,
                                        "SUBJECT",
                                        task->tokens);
-                       g_array_free (words, TRUE);
+
+                       rspamd_mempool_add_destructor (task->task_pool,
+                                       rspamd_array_free_hard, words);
                }
        }