From: Vsevolod Stakhov Date: Sat, 16 Jan 2016 21:17:00 +0000 (+0000) Subject: Fix crash X-Git-Tag: 1.1.0~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86e57953828906eb61b38c0d1ec13f1be13ef485;p=rspamd.git Fix crash --- diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 2c36a1758..41d03240a 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -780,16 +780,14 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv) if (reply->elements == task->tokens->len) { for (i = 0; i < reply->elements; i ++) { + tok = g_ptr_array_index (task->tokens, i); elt = reply->element[i]; if (G_LIKELY (elt->type == REDIS_REPLY_INTEGER)) { - tok = g_ptr_array_index (task->tokens, i); tok->values[rt->id] = elt->integer; found ++; } else if (elt->type == REDIS_REPLY_STRING) { - tok = g_ptr_array_index (task->tokens, i); - if (rt->stcf->clcf->flags & RSPAMD_FLAG_CLASSIFIER_INTEGER) { rspamd_strtoul (elt->str, elt->len, &val);