]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Plug memory leak in language detector (affects reloads)
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 28 Sep 2018 17:16:26 +0000 (18:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 28 Sep 2018 17:16:26 +0000 (18:16 +0100)
src/libmime/lang_detection.c

index 5c8d96f66cd602d41583e6eb3418776d4c1ae516..f4811f18b756baa3946d3c0ca7041d6c09f83433 100644 (file)
@@ -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,