summaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-20 12:06:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-20 12:06:04 +0100
commit91016039aac6fc2d9f8289bad8850af09820f113 (patch)
tree99d874498f2c18d7a8fa26bb242f576a158ed67b /src/libstat
parented77411e31cb1330ef54c8fe2b2c5eda506eddc1 (diff)
downloadrspamd-91016039aac6fc2d9f8289bad8850af09820f113.tar.gz
rspamd-91016039aac6fc2d9f8289bad8850af09820f113.zip
[Fix] Fix crash on redis learn
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/backends/redis_backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 88aa0d919..9b71b1a17 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -886,8 +886,10 @@ rspamd_redis_learned (redisAsyncContext *c, gpointer r, gpointer priv)
rspamd_session_remove_event (task->s, rspamd_redis_fin_learn, rt);
}
- redisAsyncFree (rt->redis);
- rt->conn_state = RSPAMD_REDIS_DISCONNECTED;
+ if (rt->conn_state == RSPAMD_REDIS_CONNECTED) {
+ redisAsyncFree (rt->redis);
+ rt->conn_state = RSPAMD_REDIS_DISCONNECTED;
+ }
}
static gboolean