commit 29ecf55ef3938656c4764517b74e1c1afbfc6c19 Author: Laurynas Biveinis Date: Tue Jun 6 13:52:32 2017 +0300 Fix bug 82283 / 1604462 (main.mysqlbinlog_debug fails with a LeakSanitizer error) Make sure mysqlbinlog.cc:dump_remote_log_entries function frees ev object on error paths. Remove redundant ASan disable for the testcase. diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 76c1f41c163..2c83477917e 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2470,6 +2470,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, MYF(MY_WME)))) { error("Could not create log file '%s'", log_file_name); + reset_temp_buf_and_delete(ev); DBUG_RETURN(ERROR_STOP); } DBUG_EXECUTE_IF("simulate_result_file_write_error_for_FD_event", @@ -2478,6 +2479,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, BIN_LOG_HEADER_SIZE, MYF(MY_NABP))) { error("Could not write into log file '%s'", log_file_name); + reset_temp_buf_and_delete(ev); DBUG_RETURN(ERROR_STOP); } /* diff --git a/mysql-test/t/mysqlbinlog_debug.test b/mysql-test/t/mysqlbinlog_debug.test index 77e3f5cb02c..cc9fba45bcb 100644 --- a/mysql-test/t/mysqlbinlog_debug.test +++ b/mysql-test/t/mysqlbinlog_debug.test @@ -2,8 +2,6 @@ # which can be executed only against debug compiled mysqlbinlog # tool. -# ASAN does not work correctly with simulated crashes ---source include/not_asan.inc --source include/mysqlbinlog_have_debug.inc -- source include/force_binlog_format_statement.inc