]> source.dussan.org Git - rspamd.git/commitdiff
* Fix addresses filling in compare_distance function
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 6 Apr 2009 16:59:16 +0000 (20:59 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 6 Apr 2009 16:59:16 +0000 (20:59 +0400)
src/expressions.c

index 2ba975b7908e490e8a7558e02d91682df7dfbda1..8dfdc17b3cfa499b7e1496570339ec5d882ced5e 100644 (file)
@@ -1029,7 +1029,7 @@ rspamd_recipients_distance (struct worker_task *task, GList *args)
        if (num < MIN_RCPT_TO_COMPARE) {
                return FALSE;
        }
-       ar = memory_pool_alloc (task->task_pool, num * sizeof (struct addr_list));
+       ar = memory_pool_alloc0 (task->task_pool, num * sizeof (struct addr_list));
 
        /* Fill array */
        cur = task->rcpts;
@@ -1041,10 +1041,8 @@ rspamd_recipients_distance (struct worker_task *task, GList *args)
                        *c = '\0';
                        ar[i].addr = c + 1;
                }
-               else {
-                       ar[i].addr = NULL;
-               }
                cur = internet_address_list_next (cur);
+               i ++;
        }
 
        /* Cycle all elements in array */