From fa51f70dc68fe2f3afe943e2c81fcbdb34f16cad Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 4 Aug 2015 23:42:44 +0200 Subject: [PATCH] correct the NULL-pointer test --- sql/item_sum.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9000289fd33..adf48f6feec 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3518,9 +3518,10 @@ bool Item_func_group_concat::setup(THD *thd) { uint n_elems= arg_count_order + all_fields.elements; ref_pointer_array= static_cast(thd->alloc(sizeof(Item*) * n_elems)); + if (!ref_pointer_array) + DBUG_RETURN(TRUE); memcpy(ref_pointer_array, args, arg_count * sizeof(Item*)); - if (!ref_pointer_array || - setup_order(thd, ref_pointer_array, context->table_list, list, + if (setup_order(thd, ref_pointer_array, context->table_list, list, all_fields, *order)) DBUG_RETURN(TRUE); }