From: Vsevolod Stakhov Date: Mon, 4 Jul 2016 12:56:30 +0000 (+0100) Subject: [Minor] Adjust array size for fuzzy commands X-Git-Tag: 1.3.0~185 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3148ef9183936dd374ae934cb53eced969ff7766;p=rspamd.git [Minor] Adjust array size for fuzzy commands --- diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 281b4d505..8ebbe68f1 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -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);