[CONC-602] Memory leak in non blocking mode Created: 2022-06-27  Updated: 2022-07-25  Resolved: 2022-07-25

Status: Closed
Project: MariaDB Connector/C
Component/s: Non blocking API
Affects Version/s: 3.3.1
Fix Version/s: 3.3.2

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue was initialliy
reported by Hyung Hwan in PR #199

If an attempt to connect to a remote server was aborted via mysql_close() allocated memory for addrinfo wlll not be freed.

Example:

int main()
{
        MYSQL mysql, *ret;
        MYSQL_RES *res;
        MYSQL_ROW row;
        int status;
 
        mysql_init(&mysql);
        mysql_options(&mysql, MYSQL_OPT_NONBLOCK, 0);
 
        status= mysql_real_connect_start(&ret, &mysql, "10.10.10.10", "username", "password", NULL, 3306, NULL, 0);
        mysql_close (&mysql);
 
        return 0;
}


Generated at Thu Feb 08 03:06:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.