summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-04 23:05:12 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-04 23:05:12 +0300
commitd7d2712f60e8b43cd9424bd56a2ec18171b501d7 (patch)
treea9bc9bb4b87ca98b05d1775adb5932aa0e378df8 /sql
parentd75ea9bcd6f7d42b70905b9c7d071e5070a07f14 (diff)
downloadmariadb-git-d7d2712f60e8b43cd9424bd56a2ec18171b501d7.tar.gz
memory leaks fixed
sql/sql_derived.cc: memory leak fixed sql/sql_view.cc: memory leak fixed
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_derived.cc8
-rw-r--r--sql/sql_view.cc6
2 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 3137890f2ba..5c827741e6d 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -220,10 +220,12 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
table->next= thd->derived_tables;
thd->derived_tables= table;
}
+ }
+ else
+ free_tmp_table(thd, table);
exit:
- delete derived_result;
- lex->current_select= save_current_select;
- }
+ delete derived_result;
+ lex->current_select= save_current_select;
DBUG_RETURN(res);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 67c7c39e223..2b1971907b3 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -339,8 +339,6 @@ static File_option view_parameters[]=
FILE_OPTIONS_STRING}
};
-static const uint required_view_parameters= 6;
-
static LEX_STRING view_file_type[]= {{(char*)"VIEW", 4}};
@@ -604,8 +602,6 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
{
/* move SP to main LEX */
sp_merge_funs(old_lex, lex);
- if (lex->spfuns.array.buffer)
- hash_free(&lex->spfuns);
if (old_lex->proc_table == 0 &&
(old_lex->proc_table=
(TABLE_LIST*)thd->calloc(sizeof(TABLE_LIST))) != 0)
@@ -619,6 +615,8 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
include_proc_table= 1;
}
}
+ if (lex->spfuns.array.buffer)
+ hash_free(&lex->spfuns);
old_next= table->next_global;
if ((table->next_global= lex->query_tables))