]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not crash if redis cache cannot be reached
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Oct 2019 16:58:10 +0000 (17:58 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Oct 2019 16:58:10 +0000 (17:58 +0100)
src/libstat/learn_cache/redis_cache.c

index a76ad585c4fd4c0da57fbab18a54645649ea5a47..0df3783abd4bcd3c434c2cd9d82d2284a227e0d1 100644 (file)
@@ -470,7 +470,7 @@ rspamd_stat_cache_redis_learn (struct rspamd_task *task,
        gchar *h;
        gint flag;
 
-       if (rspamd_session_blocked (task->s)) {
+       if (rt == NULL || rt->ctx == NULL || rspamd_session_blocked (task->s)) {
                return RSPAMD_LEARN_INGORE;
        }