diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-20 12:06:04 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-20 12:06:04 +0100 |
commit | 91016039aac6fc2d9f8289bad8850af09820f113 (patch) | |
tree | 99d874498f2c18d7a8fa26bb242f576a158ed67b /src/libstat | |
parent | ed77411e31cb1330ef54c8fe2b2c5eda506eddc1 (diff) | |
download | rspamd-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.c | 6 |
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 |