Commit 08ac1d1b authored by serg@serg.mylan's avatar serg@serg.mylan

memory leak in tz code closed

(table opened in my_tz_init, was removed from thd->open_tables in
tz_load_from_db w/o being unlocked, so it was stayng in open_cache
forever preventing the latter from being free'd in table_cache_free)
parent 3236093b
......@@ -1498,7 +1498,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
{
sql_print_error("Fatal error: Can't lock time zone table: %s",
thd->net.last_error);
goto end_with_cleanup;
goto end_with_close;
}
......@@ -1563,6 +1563,9 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
end_with_unlock:
mysql_unlock_tables(thd, lock);
end_with_close:
close_thread_tables(thd);
thd->version--; /* Force close to free memory */
end_with_setting_default_tz:
......@@ -1584,7 +1587,6 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap)
if (return_val)
my_tz_free();
end:
close_thread_tables(thd);
delete thd;
if (org_thd)
org_thd->store_globals(); /* purecov: inspected */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment