diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 18:07:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-07-30 18:07:17 +0100 |
commit | 8dc7b152a5d0624086c449375178f1d9777ff409 (patch) | |
tree | 1ae50be8696d812f09df54163b644957485191f1 | |
parent | cf781d03a009818af8b74be100a7eadb353a5ad8 (diff) | |
download | rspamd-8dc7b152a5d0624086c449375178f1d9777ff409.tar.gz rspamd-8dc7b152a5d0624086c449375178f1d9777ff409.zip |
[Minor] Fix reload leak in dkim module
-rw-r--r-- | src/plugins/dkim_check.c | 8 |
1 files changed, 7 insertions, 1 deletions
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"); |