]> source.dussan.org Git - rspamd.git/commitdiff
Fix destructors adding.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 10 Mar 2011 15:30:12 +0000 (18:30 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 10 Mar 2011 15:30:12 +0000 (18:30 +0300)
src/plugins/surbl.c

index d0b58b18a127d27d819d9b69b48a371e04ed2e8b..90ee260fd059c2913e3bbf1f0b417472b0e3602b 100644 (file)
@@ -217,9 +217,6 @@ surbl_module_init (struct config_file *cfg, struct module_ctx **ctx)
        memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_hash_table_destroy, surbl_module_ctx->whitelist);
        memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_hash_table_destroy, surbl_module_ctx->redirector_hosts);
 
-       memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_list_free, surbl_module_ctx->suffixes);
-       memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_list_free, surbl_module_ctx->bits);
-
        memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) rspamd_trie_free, surbl_module_ctx->redirector_trie);
        memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_ptr_array_unref, surbl_module_ctx->redirector_ptrs);
 
@@ -405,6 +402,15 @@ surbl_module_config (struct config_file *cfg)
 
        register_bit_symbols (cfg);
 
+       if (surbl_module_ctx->suffixes != NULL) {
+               memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_list_free,
+                               surbl_module_ctx->suffixes);
+       }
+       if (surbl_module_ctx->bits != NULL) {
+               memory_pool_add_destructor (surbl_module_ctx->surbl_pool, (pool_destruct_func) g_list_free,
+                               surbl_module_ctx->bits);
+       }
+
        return TRUE;
 }