summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 0ac61513d22..521cedffc81 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1501,7 +1501,7 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
DBUG_ASSERT(cache_mngr->trx_cache.empty() && cache_mngr->stmt_cache.empty());
thd_set_ha_data(thd, binlog_hton, NULL);
cache_mngr->~binlog_cache_mngr();
- my_free((uchar*)cache_mngr, MYF(0));
+ my_free(cache_mngr);
return 0;
}
@@ -2245,7 +2245,8 @@ shutdown the MySQL server and restart it.", name, errno);
if (file >= 0)
mysql_file_close(file, MYF(0));
end_io_cache(&log_file);
- safeFree(name);
+ my_free(name);
+ name= NULL;
log_state= LOG_CLOSED;
DBUG_RETURN(1);
}
@@ -2306,7 +2307,8 @@ void MYSQL_LOG::close(uint exiting)
}
log_state= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED;
- safeFree(name);
+ my_free(name);
+ name= NULL;
DBUG_VOID_RETURN;
}
@@ -2384,7 +2386,7 @@ void MYSQL_QUERY_LOG::reopen_file()
*/
open(save_name, log_type, 0, io_cache_type);
- my_free(save_name, MYF(0));
+ my_free(save_name);
mysql_mutex_unlock(&LOCK_log);
@@ -2985,7 +2987,8 @@ shutdown the MySQL server and restart it.", name, errno);
mysql_file_close(file, MYF(0));
end_io_cache(&log_file);
end_io_cache(&index_file);
- safeFree(name);
+ my_free(name);
+ name= NULL;
log_state= LOG_CLOSED;
DBUG_RETURN(1);
}
@@ -3318,7 +3321,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
need_start_event=1;
if (!open_index_file(index_file_name, 0, FALSE))
open(save_name, log_type, 0, io_cache_type, no_auto_events, max_size, 0, FALSE);
- my_free((uchar*) save_name, MYF(0));
+ my_free((void *) save_name);
err:
if (error == 1)
@@ -3456,7 +3459,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
DBUG_ASSERT(!included || rli->linfo.index_file_start_offset == 0);
err:
- my_free(to_purge_if_included, MYF(0));
+ my_free(to_purge_if_included);
mysql_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
}
@@ -4096,7 +4099,7 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
if (!open_index_file(index_file_name, 0, FALSE))
open(old_name, log_type, new_name_ptr,
io_cache_type, no_auto_events, max_size, 1, FALSE);
- my_free(old_name,MYF(0));
+ my_free(old_name);
end:
if (need_lock)
@@ -4354,7 +4357,7 @@ int THD::binlog_setup_trx_data()
open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir,
LOG_PREFIX, binlog_cache_size, MYF(MY_WME)))
{
- my_free((uchar*)cache_mngr, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(cache_mngr);
DBUG_RETURN(1); // Didn't manage to set it up
}
thd_set_ha_data(this, binlog_hton, cache_mngr);
@@ -5361,7 +5364,8 @@ void MYSQL_BIN_LOG::close(uint exiting)
}
}
log_state= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED;
- safeFree(name);
+ my_free(name);
+ name= NULL;
DBUG_VOID_RETURN;
}
@@ -6052,7 +6056,7 @@ void TC_LOG_MMAP::close()
mysql_cond_destroy(&pages[i].cond);
}
case 3:
- my_free((uchar*)pages, MYF(0));
+ my_free(pages);
case 2:
my_munmap((char*)data, (size_t)file_length);
case 1: