]> source.dussan.org Git - rspamd.git/commitdiff
[CritFix] Fix ttl based expiration from LRU cache
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Apr 2016 16:28:09 +0000 (17:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Apr 2016 16:28:09 +0000 (17:28 +0100)
src/libutil/hash.c

index ddf916c20486be8b556334e8d88466d76cd4fe86..f1279798ada93eeba7c87818f203a23b27daec31 100644 (file)
@@ -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;