You've already forked mariadb-connector-c
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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user