aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-26 16:11:37 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-02-26 16:11:37 +0000
commit7d04b331647d7738e5c273936ed0155960835bae (patch)
treeffd59a1704254a92db3e0f968ba5c6184bcf0dcf
parentceaafac997acb1cd58c4682f26de0be9dfe11da6 (diff)
downloadrspamd-7d04b331647d7738e5c273936ed0155960835bae.tar.gz
rspamd-7d04b331647d7738e5c273936ed0155960835bae.zip
[Minor] Fix leak
-rw-r--r--src/libmime/lang_detection.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c
index 9c29212dd..7bfcf0164 100644
--- a/src/libmime/lang_detection.c
+++ b/src/libmime/lang_detection.c
@@ -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;
}