mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31995 Fix2 allocate memory in mem_root properly.
Lex_ident_sys had no new operator and was used incorrectly in save_item_list_names(), so leaked memory.
This commit is contained in:
@@ -10697,8 +10697,9 @@ bool st_select_lex::save_item_list_names(THD *thd)
|
||||
|
||||
while ((item= li++))
|
||||
{
|
||||
if (unlikely(orig_names_of_item_list_elems->push_back(
|
||||
new Lex_ident_sys(item->name.str, item->name.length), thd->mem_root)))
|
||||
Lex_ident_sys *name= new (thd->mem_root) Lex_ident_sys(thd, &item->name);
|
||||
if (unlikely(!name ||
|
||||
orig_names_of_item_list_elems->push_back(name, thd->mem_root)))
|
||||
{
|
||||
if (arena)
|
||||
thd->restore_active_arena(arena, &backup);
|
||||
|
Reference in New Issue
Block a user