aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-18 12:54:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-18 12:54:16 +0100
commit8d393a012f52e57ab6bc7cc0c8da0c64ccd10ea9 (patch)
tree67d8776790588c4bc85914749e7539eca39259ae
parentda60dec1d43594695255180ed9dbcb680305e941 (diff)
downloadrspamd-8d393a012f52e57ab6bc7cc0c8da0c64ccd10ea9.tar.gz
rspamd-8d393a012f52e57ab6bc7cc0c8da0c64ccd10ea9.zip
[CritFix] Fix maps after reload
Issue: #2293
-rw-r--r--src/libserver/cfg_utils.c3
-rw-r--r--src/libutil/util.c13
-rw-r--r--src/rspamd.c5
3 files changed, 19 insertions, 2 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 284a40672..48c4d5eed 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -1900,6 +1900,9 @@ rspamd_config_radix_from_ucl (struct rspamd_config *cfg,
const ucl_object_t *cur, *cur_elt;
const gchar *str;
+ /* Cleanup */
+ *target = NULL;
+
LL_FOREACH (obj, cur_elt) {
type = ucl_object_type (cur_elt);
diff --git a/src/libutil/util.c b/src/libutil/util.c
index 3193f8e8d..4616bedc0 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -2189,6 +2189,19 @@ rspamd_config_libs (struct rspamd_external_libs_ctx *ctx,
magic_load (ctx->libmagic, cfg->magic_file);
}
+ rspamd_free_zstd_dictionary (ctx->in_dict);
+ rspamd_free_zstd_dictionary (ctx->out_dict);
+
+ if (ctx->out_zstream) {
+ ZSTD_freeCStream (ctx->out_zstream);
+ ctx->out_zstream = NULL;
+ }
+
+ if (ctx->in_zstream) {
+ ZSTD_freeDStream (ctx->in_zstream);
+ ctx->in_zstream = NULL;
+ }
+
if (cfg->zstd_input_dictionary) {
ctx->in_dict = rspamd_open_zstd_dictionary (
cfg->zstd_input_dictionary);
diff --git a/src/rspamd.c b/src/rspamd.c
index 7a2ce2daa..d7543643e 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -289,8 +289,9 @@ reread_config (struct rspamd_main *rspamd_main)
rspamd_main->cfg = tmp_cfg;
if (!load_rspamd_config (rspamd_main, tmp_cfg, TRUE,
- RSPAMD_CONFIG_INIT_VALIDATE|RSPAMD_CONFIG_INIT_SYMCACHE,
- TRUE)) {
+ RSPAMD_CONFIG_INIT_VALIDATE|RSPAMD_CONFIG_INIT_SYMCACHE|
+ RSPAMD_CONFIG_INIT_LIBS|RSPAMD_CONFIG_INIT_URL,
+ TRUE)) {
rspamd_main->cfg = old_cfg;
rspamd_log_close_priv (rspamd_main->logger,
rspamd_main->workers_uid,