diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e9873d2325f..6c940661763 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3155,8 +3155,9 @@ end: /* Restore original LEX value, statement's arena and THD arena values. */ lex_end(thd->lex); - if (i_s_arena.free_list) - i_s_arena.free_items(); + // Free items, before restoring backup_arena below. + DBUG_ASSERT(i_s_arena.free_list == NULL); + thd->free_items(); /* For safety reset list of open temporary tables before closing