1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix memory leak on Alter_drop allocation

Fixes 7f613ebdb6 (MDEV-7284 INDEX: CREATE OR REPLACE).
This commit is contained in:
Aleksey Midenkov
2020-10-22 17:09:18 +03:00
parent 1657b7a583
commit 0d581562d8

View File

@ -6719,7 +6719,7 @@ remove_key:
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