1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-07-30 19:03:17 +03:00

mysql_init: early alloc failure not freed

Its possible for the net extensions allocation to
succeed but the other extensions to fail to allocate.

In this later case free the net alternatives explicitly
if we where going to free the entire allocation.
This commit is contained in:
Daniel Black
2025-05-27 16:05:36 +10:00
parent 163fc458a2
commit b22b85bcdf

View File

@ -1357,7 +1357,11 @@ mysql_init(MYSQL *mysql)
return mysql;
error:
if (mysql->free_me)
{
if (mysql->net.extension)
free(mysql->net.extension);
free(mysql);
}
return 0;
}