1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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.
This commit is contained in:
kroki/tomash@moonlight.home
2007-01-31 21:16:48 +03:00
parent 52e614c5d4
commit 84ca9c72ca
2 changed files with 12 additions and 5 deletions

View File

@@ -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;
}