From 406063d0a3354cbae40a00e8fcdb6cab55a58a08 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 19 Apr 2016 17:28:09 +0100 Subject: [PATCH] [CritFix] Fix ttl based expiration from LRU cache --- src/libutil/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/hash.c b/src/libutil/hash.c index ddf916c20..f1279798a 100644 --- a/src/libutil/hash.c +++ b/src/libutil/hash.c @@ -122,7 +122,7 @@ rspamd_lru_hash_lookup (rspamd_lru_hash_t *hash, gconstpointer key, time_t now) res = g_hash_table_lookup (hash->tbl, key); if (res != NULL) { if (res->ttl != 0) { - if (((guint)now) - res->helt.pri > res->ttl) { + if (((guint)now) - res->storage > res->ttl) { rspamd_min_heap_remove_elt (hash->heap, &res->helt); g_hash_table_remove (hash->tbl, key); return NULL; -- 2.39.5