Skip to content
Permalink
Browse files

Fix warning discovered by ASAN

Patch submitted by Eugene Kosov <claprix@yandex.ru>,
comments added by commiter.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
  • Loading branch information...
kevgs authored and cvicentiu committed Jul 5, 2017
1 parent e555540 commit 4693f01f57406f86a26b7ccc605522dac6a9abb2
Showing with 5 additions and 2 deletions.
  1. +5 −2 sql/sql_explain.cc
@@ -349,10 +349,13 @@ int print_explain_row(select_result_sink *result,
item_list.push_back(new (mem_root) Item_string_sys(thd, jtype_str),
mem_root);

/* 'possible_keys' */
/* 'possible_keys'
The buffer must not be deallocated before we call send_data, otherwise
we may end up reading freed memory.
*/
StringBuffer<64> possible_keys_buf;
if (possible_keys && !possible_keys->is_empty())
{
StringBuffer<64> possible_keys_buf;
push_string_list(thd, &item_list, *possible_keys, &possible_keys_buf);
}
else

0 comments on commit 4693f01

Please sign in to comment.
You can’t perform that action at this time.