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;
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;
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;
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);
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;