aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/lang_detection.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-28 18:16:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-09-28 18:16:26 +0100
commitef80e47f74eeb61e464daba93dcef754dfe210e4 (patch)
treefc15405b286a11ec0f236e8857ee6de1d29cd583 /src/libmime/lang_detection.c
parent0e80857cdb12d45f42c3f18263c4ddee263326ad (diff)
downloadrspamd-ef80e47f74eeb61e464daba93dcef754dfe210e4.tar.gz
rspamd-ef80e47f74eeb61e464daba93dcef754dfe210e4.zip
[Fix] Plug memory leak in language detector (affects reloads)
Diffstat (limited to 'src/libmime/lang_detection.c')
-rw-r--r--src/libmime/lang_detection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c
index 5c8d96f66..f4811f18b 100644
--- a/src/libmime/lang_detection.c
+++ b/src/libmime/lang_detection.c
@@ -795,6 +795,10 @@ rspamd_language_detector_init (struct rspamd_config *cfg)
(gint)ret->languages->len,
(gint)total);
+ if (stop_words) {
+ ucl_object_unref (stop_words);
+ }
+
REF_INIT_RETAIN (ret, rspamd_language_detector_dtor);
rspamd_mempool_add_destructor (cfg->cfg_pool,
(rspamd_mempool_destruct_t)rspamd_language_detector_unref,