Commit cfa33018 authored by unknown's avatar unknown

fixed memory leak in ANALIZE initialization error reporting

parent cad553de
...@@ -58,6 +58,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -58,6 +58,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
if ((*param->item)->type() != Item::INT_ITEM || if ((*param->item)->type() != Item::INT_ITEM ||
(*param->item)->val() < 0) (*param->item)->val() < 0)
{ {
delete pc;
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name); net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
return 0; return 0;
} }
...@@ -65,6 +66,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -65,6 +66,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
param = param->next; param = param->next;
if (param->next) // no third parameter possible if (param->next) // no third parameter possible
{ {
delete pc;
net_printf(&thd->net, ER_WRONG_PARAMCOUNT_TO_PROCEDURE, proc_name); net_printf(&thd->net, ER_WRONG_PARAMCOUNT_TO_PROCEDURE, proc_name);
return 0; return 0;
} }
...@@ -72,6 +74,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -72,6 +74,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
if ((*param->item)->type() != Item::INT_ITEM || if ((*param->item)->type() != Item::INT_ITEM ||
(*param->item)->val() < 0) (*param->item)->val() < 0)
{ {
delete pc;
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name); net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
return 0; return 0;
} }
...@@ -80,6 +83,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, ...@@ -80,6 +83,7 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result,
else if ((*param->item)->type() != Item::INT_ITEM || else if ((*param->item)->type() != Item::INT_ITEM ||
(*param->item)->val() < 0) (*param->item)->val() < 0)
{ {
delete pc;
net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name); net_printf(&thd->net, ER_WRONG_PARAMETERS_TO_PROCEDURE, proc_name);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment