]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix double free
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Jun 2018 18:21:56 +0000 (19:21 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Jun 2018 18:21:56 +0000 (19:21 +0100)
src/plugins/fuzzy_check.c

index 0266d3eddbc2c975b09676e55cfde7cab3ec5d69..e1ac4743bd8c6e743557ae6e18059210011753cb 100644 (file)
@@ -422,6 +422,7 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
                        fuzzy_module_ctx->fuzzy_pool);
        rule->learn_condition_cb = -1;
        rule->alg = RSPAMD_SHINGLES_OLD;
+       rule->skip_map = NULL;
 
        if ((value = ucl_object_lookup (obj, "skip_hashes")) != NULL) {
                rspamd_map_add_from_ucl (cfg, value,
@@ -430,12 +431,6 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
                                rspamd_kv_list_fin,
                                rspamd_kv_list_dtor,
                                (void **)&rule->skip_map);
-               rspamd_mempool_add_destructor (fuzzy_module_ctx->fuzzy_pool,
-                               (rspamd_mempool_destruct_t)rspamd_map_helper_destroy_radix,
-                               rule->skip_map);
-       }
-       else {
-               rule->skip_map = NULL;
        }
 
        if ((value = ucl_object_lookup (obj, "mime_types")) != NULL) {