You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
CONC-622: Fix double free() if asnyc connect failed
If mysql_real_connect_start/cont failed, we need to set async->pvio to zero after calling ma_pvio_close to avoid double free() in mysql_close.
This commit is contained in:
@@ -1727,6 +1727,14 @@ restart:
|
||||
if (ma_pvio_connect(pvio, &cinfo) != 0)
|
||||
{
|
||||
ma_pvio_close(pvio);
|
||||
if (mysql->options.extension && mysql->options.extension->async_context &&
|
||||
mysql->options.extension->async_context->pvio)
|
||||
{
|
||||
/* pvio delegated to mysql->net.pvio by ma_net_init().
|
||||
* invalidate the pvio pointer in the async context */
|
||||
mysql->options.extension->async_context->pvio = NULL;
|
||||
}
|
||||
|
||||
if (is_multi)
|
||||
{
|
||||
connect_attempts++;
|
||||
|
Reference in New Issue
Block a user