From: Vsevolod Stakhov Date: Sat, 14 Oct 2017 17:51:16 +0000 (+0100) Subject: [CritFix] Fix memory leak in spf caching logic X-Git-Tag: 1.6.5~3^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eeee56a2eeb21b5502a308ada9ab19e05d45411b;p=rspamd.git [CritFix] Fix memory leak in spf caching logic MFH: rspamd-1.6 --- 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); }