Skip to content

Commit 0e25cc5

Browse files
committed
MDEV-34397: "delete si" rather than "my_free(si)" in THD::register_slave()
In the error case of THD::register_slave(), there is undefined behavior of Slave_info si because it is allocated via malloc() (my_malloc), and cleaned up via delete(). This patch makes these consistent by switching si's cleanup to use my_free.
1 parent 10fbd1c commit 0e25cc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/repl_failsafe.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int THD::register_slave(uchar *packet, size_t packet_length)
159159
return 0;
160160

161161
err:
162-
delete si;
162+
my_free(si);
163163
my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */
164164
return 1;
165165
}

0 commit comments

Comments
 (0)