diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-19 13:01:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-19 13:01:58 +0100 |
commit | 52a9a2eed69bed33764a2eb66715711ea660fbeb (patch) | |
tree | 7b1c45e487cd2e05433af5128efe21ffbdd4f7f0 /src/libserver/dynamic_cfg.c | |
parent | 1bd9b92735543e0ad651a60f2b05c567e8139933 (diff) | |
download | rspamd-52a9a2eed69bed33764a2eb66715711ea660fbeb.tar.gz rspamd-52a9a2eed69bed33764a2eb66715711ea660fbeb.zip |
[Fix] Fix destruction logic
Issue: #2295
Diffstat (limited to 'src/libserver/dynamic_cfg.c')
-rw-r--r-- | src/libserver/dynamic_cfg.c | 7 |
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); |