]> source.dussan.org Git - rspamd.git/commitdiff
Fix crash
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Jan 2016 21:17:00 +0000 (21:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 16 Jan 2016 21:17:00 +0000 (21:17 +0000)
src/libstat/backends/redis_backend.c

index 2c36a17587fc6699eeb95812fb47fdee50850d68..41d03240a41655808b1c0f10c90f8d3aeb9b7c28 100644 (file)
@@ -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);