From 8dc7b152a5d0624086c449375178f1d9777ff409 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 30 Jul 2018 18:07:17 +0100 Subject: [PATCH] [Minor] Fix reload leak in dkim module --- src/plugins/dkim_check.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index cfee44e8c..543921214 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -65,7 +65,6 @@ struct dkim_ctx { const gchar *symbol_na; const gchar *symbol_permfail; - rspamd_mempool_t *dkim_pool; struct rspamd_radix_map_helper *whitelist_ip; struct rspamd_hash_map_helper *dkim_domains; guint strict_multiplier; @@ -472,6 +471,13 @@ dkim_module_config (struct rspamd_config *cfg) g_free, (GDestroyNotify)rspamd_dkim_sign_key_unref); + rspamd_mempool_add_destructor (cfg->cfg_pool, + (rspamd_mempool_destruct_t)rspamd_lru_hash_destroy, + dkim_module_ctx->dkim_hash); + rspamd_mempool_add_destructor (cfg->cfg_pool, + (rspamd_mempool_destruct_t)rspamd_lru_hash_destroy, + dkim_module_ctx->dkim_sign_hash); + if (dkim_module_ctx->trusted_only && !got_trusted) { msg_err_config ( "trusted_only option is set and no trusted domains are defined; disabling dkim module completely as it is useless in this case"); -- 2.39.5