Commit 8ae7ef46 authored by unknown's avatar unknown

Don't use free'd memory, bad idea

Free all memory with mutex and destroy mutex as final step

parent 2287cee6
...@@ -864,20 +864,22 @@ release_table_log() ...@@ -864,20 +864,22 @@ release_table_log()
TABLE_LOG_MEMORY_ENTRY *used_list= global_table_log.first_used; TABLE_LOG_MEMORY_ENTRY *used_list= global_table_log.first_used;
DBUG_ENTER("release_table_log"); DBUG_ENTER("release_table_log");
VOID(pthread_mutex_destroy(&LOCK_gtl)); lock_global_table_log();
while (used_list) while (used_list)
{ {
TABLE_LOG_MEMORY_ENTRY *tmp= used_list; TABLE_LOG_MEMORY_ENTRY *tmp= used_list->next_log_entry;
my_free((char*)used_list, MYF(0)); my_free((char*)used_list, MYF(0));
used_list= tmp->next_log_entry; used_list= tmp;
} }
while (free_list) while (free_list)
{ {
TABLE_LOG_MEMORY_ENTRY *tmp= free_list; TABLE_LOG_MEMORY_ENTRY *tmp= free_list->next_log_entry;
my_free((char*)free_list, MYF(0)); my_free((char*)free_list, MYF(0));
free_list= tmp->next_log_entry; free_list= tmp;
} }
VOID(my_close(global_table_log.file_id, MYF(0))); VOID(my_close(global_table_log.file_id, MYF(0)));
unlock_global_table_log();
VOID(pthread_mutex_destroy(&LOCK_gtl));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
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