1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fix crash (introduced by CLIENT_REMEMBER_OPTIONS leak fix)

see also http://lists.askmonty.org/pipermail/commits/2016-August/009643.html
This commit is contained in:
Georg Richter
2016-08-19 08:24:47 +02:00
parent 9207626bb4
commit c374386bce
2 changed files with 24 additions and 23 deletions

View File

@@ -353,7 +353,7 @@ MK_ASYNC_START_BODY(
parms.db= db; parms.db= db;
parms.port= port; parms.port= port;
parms.unix_socket= unix_socket; parms.unix_socket= unix_socket;
parms.client_flags= client_flags; parms.client_flags= client_flags | CLIENT_REMEMBER_OPTIONS;
}, },
NULL, NULL,
r_ptr, r_ptr,

View File

@@ -1480,7 +1480,8 @@ error:
end_server(mysql); end_server(mysql);
/* only free the allocated memory, user needs to call mysql_close */ /* only free the allocated memory, user needs to call mysql_close */
mysql_close_memory(mysql); mysql_close_memory(mysql);
if (!(client_flag & CLIENT_REMEMBER_OPTIONS)) if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
!mysql->options.extension->async_context)
mysql_close_options(mysql); mysql_close_options(mysql);
return(0); return(0);
} }