]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Plug reload leaks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Jan 2017 16:52:45 +0000 (16:52 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Jan 2017 16:52:45 +0000 (16:52 +0000)
src/controller.c
src/fuzzy_storage.c
src/hs_helper.c
src/rspamd_proxy.c
src/worker.c

index 48c89c4084976a964e88ac4f6253cbd436e89bf7..675671aa0f8006c334fc7ed60ef1b24389efa354 100644 (file)
@@ -3051,7 +3051,8 @@ init_controller_worker (struct rspamd_config *cfg)
 
        type = g_quark_try_string ("controller");
 
-       ctx = g_malloc0 (sizeof (struct rspamd_controller_worker_ctx));
+       ctx = rspamd_mempool_alloc0 (cfg->cfg_pool,
+                       sizeof (struct rspamd_controller_worker_ctx));
 
        ctx->magic = rspamd_controller_ctx_magic;
        ctx->timeout = DEFAULT_WORKER_IO_TIMEOUT;
index 94dfa906c025ffa4de6302b2309da4f99b232459..7a980ceefc01b83a8d71839868c8646d54cacfac 100644 (file)
@@ -2021,7 +2021,8 @@ init_fuzzy (struct rspamd_config *cfg)
 
        type = g_quark_try_string ("fuzzy");
 
-       ctx = g_malloc0 (sizeof (struct rspamd_fuzzy_storage_ctx));
+       ctx = rspamd_mempool_alloc0 (cfg->cfg_pool,
+                       sizeof (struct rspamd_fuzzy_storage_ctx));
 
        ctx->magic = rspamd_fuzzy_storage_magic;
        ctx->sync_timeout = DEFAULT_SYNC_TIMEOUT;
index 088aba8ae370eecccb3fb66172189073a05d8f0f..94e50e7212d4c3ef617777ef66024955b8892157 100644 (file)
@@ -62,7 +62,7 @@ init_hs_helper (struct rspamd_config *cfg)
        GQuark type;
 
        type = g_quark_try_string ("hs_helper");
-       ctx = g_malloc0 (sizeof (*ctx));
+       ctx = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (*ctx));
 
        ctx->magic = rspamd_hs_helper_magic;
        ctx->cfg = cfg;
index d4a2c1b57edc2636556f7e846694ce10cb683d89..8e2b205b7a631c4f1575c55965d871c8c710a2c6 100644 (file)
@@ -620,7 +620,8 @@ init_rspamd_proxy (struct rspamd_config *cfg)
 
        type = g_quark_try_string ("rspamd_proxy");
 
-       ctx = g_malloc0 (sizeof (struct rspamd_proxy_ctx));
+       ctx = rspamd_mempool_alloc (cfg->cfg_pool,
+                       sizeof (struct rspamd_proxy_ctx));
        ctx->magic = rspamd_rspamd_proxy_magic;
        ctx->timeout = 10.0;
        ctx->upstreams = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal);
index 9d4b175a3549186cf7c1b322989ee63a471d398d..bf50e5210cf23cad6cb71b1202995d1e1ef75b17 100644 (file)
@@ -488,7 +488,8 @@ init_worker (struct rspamd_config *cfg)
 
        type = g_quark_try_string ("normal");
 
-       ctx = g_malloc0 (sizeof (struct rspamd_worker_ctx));
+       ctx = rspamd_mempool_alloc (cfg->cfg_pool,
+                       sizeof (struct rspamd_worker_ctx));
 
        ctx->magic = rspamd_worker_magic;
        ctx->is_mime = TRUE;