summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-04 12:34:41 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-04 12:34:41 +0300
commit99bf885bf5044d99d0597f5e177162c851e32359 (patch)
tree2ba1f2949a2affb1ca1b644ea6f7f42058c7df90
parent2ba15ca693fbc194d06d8153a598541880233cb3 (diff)
downloadmariadb-git-99bf885bf5044d99d0597f5e177162c851e32359.tar.gz
fixed problem with freeing stack memory
-rw-r--r--sql/sql_base.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 61387ece7b2..7a908120774 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -913,14 +913,13 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
*/
{
char path[FN_REFLEN];
- TABLE tab;
- if (!table)
- table= &tab;
strxnmov(path, FN_REFLEN, mysql_data_home, "/", table_list->db, "/",
table_list->real_name, reg_ext, NullS);
(void) unpack_filename(path, path);
if (mysql_frm_type(path) == FRMTYPE_VIEW)
{
+ TABLE tab;// will not be used (because it's VIEW) but have to be passed
+ table= &tab;
VOID(pthread_mutex_lock(&LOCK_open));
if (open_unireg_entry(thd, table, table_list->db,
table_list->real_name,
@@ -932,7 +931,6 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
else
{
DBUG_ASSERT(table_list->view);
- my_free((gptr)table, MYF(0));
VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(0); // VIEW
}