From 1af89c35663dd364c8d46523f0d71adc64f8bde4 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Aug 2018 12:51:54 +0100 Subject: [Fix] Add fail-safety for destroying sessions --- src/libstat/learn_cache/redis_cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libstat/learn_cache') diff --git a/src/libstat/learn_cache/redis_cache.c b/src/libstat/learn_cache/redis_cache.c index d43ec3665..e17f20d27 100644 --- a/src/libstat/learn_cache/redis_cache.c +++ b/src/libstat/learn_cache/redis_cache.c @@ -438,6 +438,10 @@ rspamd_stat_cache_redis_check (struct rspamd_task *task, struct timeval tv; gchar *h; + if (rspamd_session_is_destroying (task->s)) { + return RSPAMD_LEARN_INGORE; + } + h = rspamd_mempool_get_variable (task->task_pool, "words_hash"); if (h == NULL) { @@ -469,6 +473,10 @@ rspamd_stat_cache_redis_learn (struct rspamd_task *task, gchar *h; gint flag; + if (rspamd_session_is_destroying (task->s)) { + return RSPAMD_LEARN_INGORE; + } + h = rspamd_mempool_get_variable (task->task_pool, "words_hash"); g_assert (h != NULL); -- cgit v1.2.3