aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_utils.c
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-09-10 17:29:44 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-09-10 17:29:44 +0100
commit942473383448b74c758ac521c7492f222c00709f (patch)
treefc54aa456ad6f860d2c2aa6b7626afe79a622f58 /src/libserver/cfg_utils.c
parentc83bbd8f504373614e029f187415576494a59a39 (diff)
parent86e0d6c14dde85306c7053d2ddac7624c3af21e1 (diff)
downloadrspamd-942473383448b74c758ac521c7492f222c00709f.tar.gz
rspamd-942473383448b74c758ac521c7492f222c00709f.zip
Merge branch 'master' into redis-coroutines
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r--src/libserver/cfg_utils.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index d07939374..fa1fac935 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -213,8 +213,6 @@ rspamd_config_free (struct rspamd_config *cfg)
struct rspamd_config_post_load_script *sc, *sctmp;
struct rspamd_worker_log_pipe *lp, *ltmp;
- rspamd_map_remove_all (cfg);
-
DL_FOREACH_SAFE (cfg->finish_callbacks, sc, sctmp) {
luaL_unref (cfg->lua_state, LUA_REGISTRYINDEX, sc->cbref);
g_free (sc);
@@ -225,9 +223,8 @@ rspamd_config_free (struct rspamd_config *cfg)
g_free (sc);
}
- if (cfg->monitored_ctx) {
- rspamd_monitored_ctx_destroy (cfg->monitored_ctx);
- }
+ rspamd_map_remove_all (cfg);
+ rspamd_mempool_destructors_enforce (cfg->cfg_pool);
g_list_free (cfg->classifiers);
g_list_free (cfg->workers);
@@ -246,10 +243,6 @@ rspamd_config_free (struct rspamd_config *cfg)
g_hash_table_unref (cfg->wrk_parsers);
g_hash_table_unref (cfg->trusted_keys);
- if (cfg->checksum) {
- g_free (cfg->checksum);
- }
-
rspamd_re_cache_unref (cfg->re_cache);
rspamd_upstreams_library_unref (cfg->ups_ctx);
g_ptr_array_free (cfg->c_modules, TRUE);
@@ -266,6 +259,12 @@ rspamd_config_free (struct rspamd_config *cfg)
#endif
rspamd_mempool_delete (cfg->cfg_pool);
+ if (cfg->monitored_ctx) {
+ rspamd_monitored_ctx_destroy (cfg->monitored_ctx);
+ }
+ if (cfg->checksum) {
+ g_free (cfg->checksum);
+ }
REF_RELEASE (cfg->libs_ctx);