summaryrefslogtreecommitdiffstats
path: root/src/libstat
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-16 21:17:00 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-16 21:17:00 +0000
commit86e57953828906eb61b38c0d1ec13f1be13ef485 (patch)
treec1854e6f2f4fcfb31f12f2f615509d42434a95ff /src/libstat
parent8681b3d813926811d67fa88a62adde561c11ffbc (diff)
downloadrspamd-86e57953828906eb61b38c0d1ec13f1be13ef485.tar.gz
rspamd-86e57953828906eb61b38c0d1ec13f1be13ef485.zip
Fix crash
Diffstat (limited to 'src/libstat')
-rw-r--r--src/libstat/backends/redis_backend.c4
1 files changed, 1 insertions, 3 deletions
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);