From: Vsevolod Stakhov Date: Thu, 10 Mar 2011 15:30:12 +0000 (+0300) Subject: Fix destructors adding. X-Git-Tag: 0.3.8~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9f33f9cd55ba2005277313d84ee2aafec058b6d0;p=rspamd.git Fix destructors adding. --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index d0b58b18a..90ee260fd 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -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; }