]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix leak
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 Feb 2019 16:11:37 +0000 (16:11 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 26 Feb 2019 16:11:37 +0000 (16:11 +0000)
src/libmime/lang_detection.c

index 9c29212dd4c9d7e7baf3667af6bc8a9f1460c94d..7bfcf01648c0ade243f762cf5f90d15b3a12306c 100644 (file)
@@ -1471,7 +1471,10 @@ rspamd_language_detector_set_language (struct rspamd_task *task,
        r->prob = 1.0;
        r->lang = code;
 
-       part->languages = g_ptr_array_sized_new (1);
+       if (part->languages == NULL) {
+               part->languages = g_ptr_array_sized_new (1);
+       }
+
        g_ptr_array_add (part->languages, r);
        part->language = code;
 }