From: Vsevolod Stakhov Date: Thu, 14 Jun 2018 14:08:01 +0000 (+0100) Subject: [Fix] Try to fix leak in dmarc module X-Git-Tag: 1.7.6~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ffba6be3740d5c3f8fe03a6a742310f6b770cff;p=thirdparty%2Frspamd.git [Fix] Try to fix leak in dmarc module --- diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 5c24bff532..53ece7aa4e 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 = {}