From 43fabec7e1b1db64bf6d36839f601f18da7bda91 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 10 Oct 2014 23:41:34 +0100 Subject: Fix C modules initialization on restart. --- src/libserver/cfg_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libserver/cfg_utils.c') diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index f7285d5ed..ed764a9ef 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -330,7 +330,9 @@ rspamd_config_defaults (struct rspamd_config *cfg) cfg->max_diff = 20480; cfg->metrics = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); - cfg->c_modules = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); + if (cfg->c_modules == NULL) { + cfg->c_modules = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); + } cfg->composite_symbols = g_hash_table_new (rspamd_str_hash, rspamd_str_equal); cfg->classifiers_symbols = g_hash_table_new (rspamd_str_hash, @@ -354,7 +356,6 @@ rspamd_config_free (struct rspamd_config *cfg) ucl_obj_unref (cfg->rcl_obj); g_hash_table_remove_all (cfg->metrics); g_hash_table_unref (cfg->metrics); - g_hash_table_remove_all (cfg->c_modules); g_hash_table_unref (cfg->c_modules); g_hash_table_remove_all (cfg->composite_symbols); g_hash_table_unref (cfg->composite_symbols); -- cgit v1.2.3