aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/dynamic_cfg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libserver/dynamic_cfg.c b/src/libserver/dynamic_cfg.c
index ed9f24b15..39b2ebf7b 100644
--- a/src/libserver/dynamic_cfg.c
+++ b/src/libserver/dynamic_cfg.c
@@ -234,6 +234,10 @@ json_config_dtor_cb (struct map_cb_data *data)
g_string_free (jb->buf, TRUE);
}
+ if (jb->cfg && jb->cfg->current_dynamic_conf) {
+ ucl_object_unref (jb->cfg->current_dynamic_conf);
+ }
+
g_free (jb);
}
}
@@ -260,9 +264,6 @@ init_dynamic_config (struct rspamd_config *cfg)
*pjb = jb;
cfg->current_dynamic_conf = ucl_object_typed_new (UCL_ARRAY);
rspamd_mempool_add_destructor (cfg->cfg_pool,
- (rspamd_mempool_destruct_t)ucl_object_unref,
- cfg->current_dynamic_conf);
- rspamd_mempool_add_destructor (cfg->cfg_pool,
(rspamd_mempool_destruct_t)g_free,
pjb);