]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix another reload memory issue
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 19 Jan 2017 10:54:24 +0000 (10:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 19 Jan 2017 10:54:24 +0000 (10:54 +0000)
src/plugins/fuzzy_check.c

index 804db15e62ddbd68a69a0b15e2b0bc74b4dfc5bd..37eeded4dda6ff23f46ec79786c29020adfd8697 100644 (file)
@@ -242,8 +242,6 @@ parse_mime_types (const gchar *str)
        strvec = g_strsplit_set (str, ",", 0);
        num = g_strv_length (strvec);
        res = g_ptr_array_sized_new (num);
-       rspamd_mempool_add_destructor (fuzzy_module_ctx->fuzzy_pool,
-                       rspamd_ptr_array_free_hard, res);
 
        for (i = 0; i < num; i++) {
                g_strstrip (strvec[i]);
@@ -417,6 +415,11 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
                                }
                        }
                }
+
+               if (rule->mime_types) {
+                       rspamd_mempool_add_destructor (fuzzy_module_ctx->fuzzy_pool,
+                                               rspamd_ptr_array_free_hard, rule->mime_types);
+               }
        }
 
        if ((value = ucl_object_lookup (obj, "headers")) != NULL) {