aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-14 18:51:16 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-14 18:51:16 +0100
commit8a16c2c819b2a4513ad2f7e3cf675eb91737bad6 (patch)
tree1ed2646a1d9810c711c5abf3bc33ea153c1a3f1b /src/plugins
parenta3ce6d43de5afb2b387e2a07cedab9004c4a0cb5 (diff)
downloadrspamd-8a16c2c819b2a4513ad2f7e3cf675eb91737bad6.tar.gz
rspamd-8a16c2c819b2a4513ad2f7e3cf675eb91737bad6.zip
[CritFix] Fix memory leak in spf caching logic
MFH: rspamd-1.6
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/spf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index 41e952eb2..09bd0fca1 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);
}