]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] More init leaks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jun 2018 13:11:30 +0000 (14:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jun 2018 13:11:30 +0000 (14:11 +0100)
src/libserver/cfg_utils.c
src/libserver/dynamic_cfg.c
src/rspamd.c

index cf7f8d847e93b8094b542d17dcf77b6f3bd9e0a4..6083d655fbff0dd86ebe8e5f34546db3c1052994 100644 (file)
@@ -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);
index 55275cba4f92f90338bc458d62c2f78abfc9a510..ed9f24b157532c76b9a44f2ba479b458e4b3b9dd 100644 (file)
@@ -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,
index 777726478c1fc6017834205a9b31459a11938229..34436bd1098041da7346c37f2aa0245d7c39b83f 100644 (file)
@@ -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);
 }