Commit 76833ac4 authored by unknown's avatar unknown

A fix for Bug#24486 "Valgrind warnings: sp_head(),

deadlock_innodb:events_grant". This was a memory leak introduced by 
the patch for Bug 22830.
Post-review fixes.


sql/sql_parse.cc:
  A fix for Bug#24486 "Valgrind warnings: sp_head(),
   deadlock_innodb:events_grant": delete the sphead object before
  returning with an error.
parent 49009cf8
...@@ -3925,6 +3925,7 @@ end_with_restore_list: ...@@ -3925,6 +3925,7 @@ end_with_restore_list:
} }
case SQLCOM_CREATE_EVENT: case SQLCOM_CREATE_EVENT:
case SQLCOM_ALTER_EVENT: case SQLCOM_ALTER_EVENT:
do
{ {
DBUG_ASSERT(lex->event_parse_data); DBUG_ASSERT(lex->event_parse_data);
if (lex->table_or_sp_used()) if (lex->table_or_sp_used())
...@@ -3950,16 +3951,15 @@ end_with_restore_list: ...@@ -3950,16 +3951,15 @@ end_with_restore_list:
if (!res) if (!res)
send_ok(thd); send_ok(thd);
/* Don't do it, if we are inside a SP */ } while (0);
if (!thd->spcont) /* Don't do it, if we are inside a SP */
{ if (!thd->spcont)
delete lex->sphead; {
lex->sphead= NULL; delete lex->sphead;
} lex->sphead= NULL;
/* lex->unit.cleanup() is called outside, no need to call it here */
break;
} }
/* lex->unit.cleanup() is called outside, no need to call it here */
break;
case SQLCOM_DROP_EVENT: case SQLCOM_DROP_EVENT:
case SQLCOM_SHOW_CREATE_EVENT: case SQLCOM_SHOW_CREATE_EVENT:
{ {
......
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