From ef80e47f74eeb61e464daba93dcef754dfe210e4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 28 Sep 2018 18:16:26 +0100 Subject: [PATCH] [Fix] Plug memory leak in language detector (affects reloads) --- src/libmime/lang_detection.c | 4 ++++ 1 file changed, 4 insertions(+) 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, -- 2.39.5