aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-31 17:58:49 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-03-31 17:58:49 +0100
commit993c1b5368e76712332c1a06952210ed22585b14 (patch)
treea1952d25958e7e959146e000d95c20686868e278 /src/libstat/stat_process.c
parent87820e7a7119207e0b8f5de334acb8fe4de1bd31 (diff)
downloadrspamd-993c1b5368e76712332c1a06952210ed22585b14.tar.gz
rspamd-993c1b5368e76712332c1a06952210ed22585b14.zip
[Minor] Delay freeing of tokens arrays when classifying
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 02425b615..22dcccc99 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -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);
}
}