summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 34ce1701424..0e6c0c45cf1 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1162,10 +1162,12 @@ bool mysql_change_db(THD *thd, const char *name, bool no_access_check)
DBUG_RETURN(1);
}
end:
- x_free(thd->db);
+ if (!(thd->slave_thread))
+ x_free(thd->db);
if (dbname && dbname[0] == 0)
{
- x_free(dbname);
+ if (!(thd->slave_thread))
+ x_free(dbname);
thd->db= NULL;
thd->db_length= 0;
}