diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-14 15:08:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-06-14 15:15:19 +0100 |
commit | 2ffba6be3740d5c3f8fe03a6a742310f6b770cff (patch) | |
tree | 6f63f40785ea07dd23987a236ac6bb83cfcde776 /src/plugins/lua/dmarc.lua | |
parent | b40fa1a48d076a675db58fffa302d26dabcd2519 (diff) | |
download | rspamd-2ffba6be3740d5c3f8fe03a6a742310f6b770cff.tar.gz rspamd-2ffba6be3740d5c3f8fe03a6a742310f6b770cff.zip |
[Fix] Try to fix leak in dmarc module
Diffstat (limited to 'src/plugins/lua/dmarc.lua')
-rw-r--r-- | src/plugins/lua/dmarc.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 5c24bff53..53ece7aa4 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -37,7 +37,7 @@ local no_reporting_domains local statefile = string.format('%s/%s', rspamd_paths['DBDIR'], 'dmarc_reports_last_sent') local VAR_NAME = 'dmarc_reports_last_sent' local INTERVAL = 86400 -local pool = mempool.create() +local pool local report_settings = { helo = 'rspamd', @@ -608,6 +608,7 @@ if opts['reporting'] == true then rspamd_config:add_on_load(function(cfg, ev_base, worker) if not worker:is_primary_controller() then return end local rresolver = rspamd_resolver.init(ev_base, rspamd_config) + pool = mempool.create() rspamd_config:register_finish_script(function () local stamp = pool:get_variable(VAR_NAME, 'double') if not stamp then @@ -621,6 +622,7 @@ if opts['reporting'] == true then end assert(f:write(pool:get_variable(VAR_NAME, 'double'))) assert(f:close()) + pool:destroy() end) local get_reporting_domain, reporting_domain, report_start, report_end, report_id, want_period, report_key local reporting_addr = {} |