Skip to content
Permalink
Browse files
Fix memory leak on Alter_drop allocation
Fixes 7f613eb (MDEV-7284 INDEX: CREATE OR REPLACE).
  • Loading branch information
midenok committed Oct 22, 2020
1 parent 1657b7a commit 0d58156
Showing 1 changed file with 1 addition and 1 deletion.
@@ -6719,7 +6719,7 @@ handle_if_exists_options(THD *thd, TABLE *table, Alter_info *alter_info,
DBUG_ASSERT(key->or_replace());
Alter_drop::drop_type type= (key->type == Key::FOREIGN_KEY) ?
Alter_drop::FOREIGN_KEY : Alter_drop::KEY;
Alter_drop *ad= new Alter_drop(type, key->name.str, FALSE);
Alter_drop *ad= new (thd->mem_root) Alter_drop(type, key->name.str, FALSE);
if (ad != NULL)
{
// Adding the index into the drop list for replacing

0 comments on commit 0d58156

Please sign in to comment.