summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-07-01 17:51:04 +0400
committerunknown <konstantin@mysql.com>2005-07-01 17:51:04 +0400
commitb32d2ac276357828b5f814df4e6eade4d37d7d1f (patch)
treea748a4e2ee0822e22ba670fe00fb5fe945d6d4f8 /sql
parenteb4cb6eba3147b271d893354465e9b2b44addd20 (diff)
downloadmariadb-git-b32d2ac276357828b5f814df4e6eade4d37d7d1f.tar.gz
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).
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_prepare.cc1
-rw-r--r--sql/sql_select.cc1
2 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index d5cf671abcd..2bf2f165a66 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -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;
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c6a9bd54f9c..f5c1c784ece 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1920,7 +1920,6 @@ Cursor::~Cursor()
{
if (is_open())
close(FALSE);
- free_root(mem_root, MYF(0));
}
/*********************************************************************/