Commit b32d2ac2 authored by unknown's avatar unknown
Browse files

Fix a valgrind warning.


sql/sql_prepare.cc:
  A small fix for the previous patch: we should first free the
  prepared statement items, and then free the runtime memory root,
  as some memory used for cleanup is allocated in that mem root.
sql/sql_select.cc:
  - ever free the cursor mem root in close() (it's too early).
parent eb4cb6eb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2447,6 +2447,7 @@ Prepared_statement::~Prepared_statement()
  if (cursor)
    cursor->Cursor::~Cursor();
  free_items();
  free_root(cursor->mem_root, MYF(0));
  delete lex->result;
}

+0 −1
Original line number Diff line number Diff line
@@ -1920,7 +1920,6 @@ Cursor::~Cursor()
{
  if (is_open())
    close(FALSE);
  free_root(mem_root, MYF(0));
}

/*********************************************************************/