From eeee56a2eeb21b5502a308ada9ab19e05d45411b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 14 Oct 2017 18:51:16 +0100 Subject: [PATCH] [CritFix] Fix memory leak in spf caching logic MFH: rspamd-1.6 --- src/plugins/spf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 097df7329..737d66348 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -526,15 +526,15 @@ spf_plugin_callback (struct spf_resolved *record, struct rspamd_task *task, if ((l = rspamd_lru_hash_lookup (spf_module_ctx->spf_hash, record->domain, task->tv.tv_sec)) == NULL) { - - l = spf_record_ref (record); + l = record; if (record->ttl > 0 && !record->temp_failed && !record->perm_failed && !record->na) { + rspamd_lru_hash_insert (spf_module_ctx->spf_hash, - record->domain, l, + record->domain, spf_record_ref (l), task->tv.tv_sec, record->ttl); } -- 2.39.5