aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-15 14:11:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-15 14:11:30 +0100
commitc08f35e976223b58cf76e8cfe2dac8f457e32fee (patch)
tree2ef363c56527e009baaeb01a47eb9a9ecd3bc7ce /src
parent3c6829656593b2fac53e09d0c34452ba1de9965d (diff)
downloadrspamd-c08f35e976223b58cf76e8cfe2dac8f457e32fee.tar.gz
rspamd-c08f35e976223b58cf76e8cfe2dac8f457e32fee.zip
[Minor] More init leaks
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_utils.c3
-rw-r--r--src/libserver/dynamic_cfg.c3
-rw-r--r--src/rspamd.c5
3 files changed, 9 insertions, 2 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index cf7f8d847..6083d655f 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -1450,9 +1450,8 @@ rspamd_init_filters (struct rspamd_config *cfg, bool reconfig)
mod = *pmod;
if (rspamd_check_module (cfg, mod)) {
- mod_ctx = g_malloc0 (sizeof (struct module_ctx));
-
if (mod->module_init_func (cfg, &mod_ctx) == 0) {
+ g_assert (mod_ctx != NULL);
g_hash_table_insert (cfg->c_modules,
(gpointer) mod->name,
mod_ctx);
diff --git a/src/libserver/dynamic_cfg.c b/src/libserver/dynamic_cfg.c
index 55275cba4..ed9f24b15 100644
--- a/src/libserver/dynamic_cfg.c
+++ b/src/libserver/dynamic_cfg.c
@@ -262,6 +262,9 @@ init_dynamic_config (struct rspamd_config *cfg)
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);
if (!rspamd_map_add (cfg,
cfg->dynamic_conf,
diff --git a/src/rspamd.c b/src/rspamd.c
index 777726478..34436bd10 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -1498,6 +1498,7 @@ main (gint argc, gchar **argv, gchar **env)
rspamd_log_close (rspamd_main->logger);
REF_RELEASE (rspamd_main->cfg);
g_hash_table_unref (rspamd_main->spairs);
+ g_hash_table_unref (rspamd_main->workers);
rspamd_mempool_delete (rspamd_main->server_pool);
if (!skip_pid) {
@@ -1507,5 +1508,9 @@ main (gint argc, gchar **argv, gchar **env)
g_free (rspamd_main);
event_base_free (ev_base);
+ if (control_addr) {
+ rspamd_inet_address_free (control_addr);
+ }
+
return (res);
}