From: Vsevolod Stakhov Date: Tue, 19 Apr 2016 16:28:09 +0000 (+0100) Subject: [CritFix] Fix ttl based expiration from LRU cache X-Git-Tag: 1.2.4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=406063d0a3354cbae40a00e8fcdb6cab55a58a08;p=thirdparty%2Frspamd.git [CritFix] Fix ttl based expiration from LRU cache --- diff --git a/src/libutil/hash.c b/src/libutil/hash.c index ddf916c204..f1279798ad 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;