aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-10 18:30:12 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-10 18:30:12 +0300
commit9f33f9cd55ba2005277313d84ee2aafec058b6d0 (patch)
treefda1916c2a38f82b3daccd70188b07eae9d428db /src
parenteda90216086cafa5c84f7a13f4d5bf72d4e225bd (diff)
downloadrspamd-9f33f9cd55ba2005277313d84ee2aafec058b6d0.tar.gz
rspamd-9f33f9cd55ba2005277313d84ee2aafec058b6d0.zip
Fix destructors adding.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/surbl.c12
1 files changed, 9 insertions, 3 deletions
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;
}