diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-08-11 17:50:21 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2016-08-11 17:50:21 +0200 |
commit | 66ac894c40ad089175aaf6d4922f7250c23b9b3d (patch) | |
tree | 5099cd2d1737b3a0d16d6c472366f00d4fb95182 /sql-common | |
parent | b5fb2a685b6ec67d37033b020a8145d1aac1fc93 (diff) | |
download | mariadb-git-66ac894c40ad089175aaf6d4922f7250c23b9b3d.tar.gz |
MDEV-10455: libmariadbclient18 + MySQL-python leaks memory on failed connections
Support of CLIENT_REMEMBER_OPTIONS and freeing options added.
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 9105b72d57c..184d7983a00 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -3644,6 +3644,8 @@ error: /* Free alloced memory */ end_server(mysql); mysql_close_free(mysql); + if (!(client_flag & CLIENT_REMEMBER_OPTIONS)) + mysql_close_free_options(mysql); } DBUG_RETURN(0); } @@ -3714,7 +3716,7 @@ my_bool mysql_reconnect(MYSQL *mysql) } if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd, mysql->db, mysql->port, mysql->unix_socket, - mysql->client_flag)) + mysql->client_flag | CLIENT_REMEMBER_OPTIONS)) { if (ctxt) my_context_install_suspend_resume_hook(ctxt, NULL, NULL); |