diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-14 18:51:16 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-14 18:51:16 +0100 |
commit | 8a16c2c819b2a4513ad2f7e3cf675eb91737bad6 (patch) | |
tree | 1ed2646a1d9810c711c5abf3bc33ea153c1a3f1b /src/plugins | |
parent | a3ce6d43de5afb2b387e2a07cedab9004c4a0cb5 (diff) | |
download | rspamd-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.c | 6 |
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); } |