summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.cc
diff options
context:
space:
mode:
authorkroki/tomash@moonlight.home <>2007-01-31 21:16:48 +0300
committerkroki/tomash@moonlight.home <>2007-01-31 21:16:48 +0300
commit84ca9c72ca314f4d535593d12715c5ba2c6178e6 (patch)
tree9006bd39b52fb50dc331dbb0e3085378893f7022 /sql/event_data_objects.cc
parent52e614c5d4b568871fcec523e9b516eec6d48490 (diff)
downloadmariadb-git-84ca9c72ca314f4d535593d12715c5ba2c6178e6.tar.gz
Fix for memory leaks introduced with the push of patch for bug#22740.
Original patch did not have these leaks, they were introduced later during manual applying of the patch.
Diffstat (limited to 'sql/event_data_objects.cc')
-rw-r--r--sql/event_data_objects.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 198f6518184..b1724a28820 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1811,16 +1811,21 @@ Event_job_data::compile(THD *thd, MEM_ROOT *mem_root)
DBUG_PRINT("error", ("error during compile or thd->is_fatal_error: %d",
thd->is_fatal_error));
/*
- Free lex associated resources
- QQ: Do we really need all this stuff here?
+ The first thing we do after parse error is freeing sp_head to
+ ensure that we have restored original memroot.
*/
+ if (lex.sphead)
+ {
+ /* Clean up after failed stored procedure/function */
+ delete lex.sphead;
+ lex.sphead= NULL;
+ }
+ lex.unit.cleanup();
+
sql_print_error("SCHEDULER: Error during compilation of %s.%s or "
"thd->is_fatal_error: %d",
dbname.str, name.str, thd->is_fatal_error);
- lex.unit.cleanup();
- delete lex.sphead;
- sphead= lex.sphead= NULL;
ret= EVEX_COMPILE_ERROR;
goto done;
}