summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-04 14:29:36 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-04 14:29:36 +0200
commit02da00a98ceb8f82a65ed72a74b53b6d5ae3d144 (patch)
tree22d8225a0de58854ed2998a70843898a5d48c76d /sql
parent3c06a0b7dc121eb606f1d56d0509326e4e7d52b4 (diff)
parenta92f07f4bd450f7368a998ce63443dd66374262a (diff)
downloadmariadb-git-02da00a98ceb8f82a65ed72a74b53b6d5ae3d144.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8f55e2c266b..cb6fee34d48 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 2022, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3290,6 +3290,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
thd->alloc(f_args.arg_count*sizeof(Item_result))))
{
+ err_exit:
free_udf(u_d);
DBUG_RETURN(TRUE);
}
@@ -3327,7 +3328,8 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
func->used_tables_and_const_cache_join(item);
f_args.arg_type[i]=item->result_type();
}
- if (!(buffers=new (thd->mem_root) String[arg_count]) ||
+ buffers=new (thd->mem_root) String[arg_count];
+ if (!buffers ||
!multi_alloc_root(thd->mem_root,
&f_args.args, arg_count * sizeof(char *),
&f_args.lengths, arg_count * sizeof(long),
@@ -3336,10 +3338,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
&f_args.attributes, arg_count * sizeof(char *),
&f_args.attribute_lengths, arg_count * sizeof(long),
NullS))
- {
- free_udf(u_d);
- DBUG_RETURN(TRUE);
- }
+ goto err_exit;
}
if (func->fix_length_and_dec())
DBUG_RETURN(TRUE);
@@ -3407,8 +3406,7 @@ udf_handler::fix_fields(THD *thd, Item_func_or_sum *func,
{
my_error(ER_CANT_INITIALIZE_UDF, MYF(0),
u_d->name.str, init_msg_buff);
- free_udf(u_d);
- DBUG_RETURN(TRUE);
+ goto err_exit;
}
func->max_length=MY_MIN(initid.max_length,MAX_BLOB_WIDTH);
func->maybe_null=initid.maybe_null;