aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/cfg_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-14 18:28:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-06-14 18:28:31 +0100
commit092129b5216cb55de385ee6138a29c537142596c (patch)
treeb7eafd1cb29323c296fcaf5304c00fb10ee6da7e /src/libserver/cfg_utils.c
parent6209436b4b4a31e3a567dbd2b58b9352aaf4967b (diff)
downloadrspamd-092129b5216cb55de385ee6138a29c537142596c.tar.gz
rspamd-092129b5216cb55de385ee6138a29c537142596c.zip
[Project] Various fixes
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r--src/libserver/cfg_utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 0c47ec22e..0f38cc389 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -246,6 +246,7 @@ void
rspamd_config_free (struct rspamd_config *cfg)
{
struct rspamd_config_post_load_script *sc, *sctmp;
+ struct rspamd_config_settings_elt *set, *stmp;
struct rspamd_worker_log_pipe *lp, *ltmp;
DL_FOREACH_SAFE (cfg->finish_callbacks, sc, sctmp) {
@@ -258,6 +259,10 @@ rspamd_config_free (struct rspamd_config *cfg)
g_free (sc);
}
+ DL_FOREACH_SAFE (cfg->setting_ids, set, stmp) {
+ REF_RELEASE (set);
+ }
+
rspamd_map_remove_all (cfg);
rspamd_mempool_destructors_enforce (cfg->cfg_pool);
@@ -2352,7 +2357,7 @@ rspamd_config_name_to_id (const gchar *name, gsize namelen)
guint64 h;
h = rspamd_cryptobox_fast_hash_specific (RSPAMD_CRYPTOBOX_XXHASH64,
- name, strlen (name), 0x0);
+ name, namelen, 0x0);
/* Take the lower part of hash as LE number */
return ((guint32)GUINT64_TO_LE (h));
}
@@ -2416,7 +2421,7 @@ rspamd_config_register_settings_id (struct rspamd_config *cfg,
}
REF_INIT_RETAIN (nelt, rspamd_config_settings_elt_dtor);
- msg_warn_config ("replace settings id %d (%s)", id, name);
+ msg_warn_config ("replace settings id %ud (%s)", id, name);
rspamd_symcache_process_settings_elt (cfg->cache, elt);
DL_APPEND (cfg->setting_ids, nelt);
@@ -2442,7 +2447,7 @@ rspamd_config_register_settings_id (struct rspamd_config *cfg,
elt->symbols_disabled = ucl_object_ref (symbols_disabled);
}
- msg_info_config ("register new settings id %d (%s)", id, name);
+ msg_info_config ("register new settings id %ud (%s)", id, name);
REF_INIT_RETAIN (elt, rspamd_config_settings_elt_dtor);
rspamd_symcache_process_settings_elt (cfg->cache, elt);
DL_APPEND (cfg->setting_ids, elt);