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.
This commit is contained in:
Brandon Nesterenko 2024-06-18 06:12:57 -06:00 committed by Brandon Nesterenko
parent 10fbd1ce51
commit 0e25cc51a9

View file

@ -159,7 +159,7 @@ int THD::register_slave(uchar *packet, size_t packet_length)
return 0;
err:
delete si;
my_free(si);
my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */
return 1;
}