Commit 9aaa8a81 authored by acurtis@xiphis.org's avatar acurtis@xiphis.org

Bug#15976: Multiply warnings about unfreed memory

  leaks caused by Archive storage engine not closing files and
  storage engines not receiving panic() during shutdown
parent 795f744c
...@@ -591,8 +591,6 @@ int ha_archive::create(const char *name, TABLE *table_arg, ...@@ -591,8 +591,6 @@ int ha_archive::create(const char *name, TABLE *table_arg,
goto error2; goto error2;
} }
my_close(create_file, MYF(0));
DBUG_RETURN(0); DBUG_RETURN(0);
error3: error3:
......
...@@ -1152,6 +1152,7 @@ void clean_up(bool print_message) ...@@ -1152,6 +1152,7 @@ void clean_up(bool print_message)
lex_free(); /* Free some memory */ lex_free(); /* Free some memory */
set_var_free(); set_var_free();
free_charsets(); free_charsets();
(void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
if (!opt_noacl) if (!opt_noacl)
{ {
#ifdef HAVE_DLOPEN #ifdef HAVE_DLOPEN
...@@ -1159,7 +1160,6 @@ void clean_up(bool print_message) ...@@ -1159,7 +1160,6 @@ void clean_up(bool print_message)
#endif #endif
plugin_free(); plugin_free();
} }
(void) ha_panic(HA_PANIC_CLOSE); /* close all tables and logs */
if (tc_log) if (tc_log)
tc_log->close(); tc_log->close();
xid_cache_free(); xid_cache_free();
......
...@@ -267,7 +267,7 @@ int destroy (s) ...@@ -267,7 +267,7 @@ int destroy (s)
err = inflateEnd(&(s->stream)); err = inflateEnd(&(s->stream));
} }
} }
if (s->file < 0 && my_close(s->file, MYF(0))) if (s->file > 0 && my_close(s->file, MYF(0)))
{ {
#ifdef ESPIPE #ifdef ESPIPE
if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
......
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