]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Adjust array size for fuzzy commands
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jul 2016 12:56:30 +0000 (13:56 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jul 2016 12:56:30 +0000 (13:56 +0100)
src/plugins/fuzzy_check.c

index 281b4d5051ea0f1f59f22c3f2b2717c89661a0c3..8ebbe68f1d71565bcf7beb940037b1063ae8ab7a 100644 (file)
@@ -1993,7 +1993,7 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule,
        guint i;
        GPtrArray *res;
 
-       res = g_ptr_array_new ();
+       res = g_ptr_array_sized_new (task->parts->len + 1);
 
        if (c == FUZZY_STAT) {
                io = fuzzy_cmd_stat (rule, c, flag, value, task->task_pool);