summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2001-10-24 21:38:48 +0200
committerunknown <serg@serg.mysql.com>2001-10-24 21:38:48 +0200
commit7fd957411712d2f24f978220615a001cf128410b (patch)
tree97b5b1f5a8446706571572cf3fea33a848a1b20c /libmysql
parentd320ee1a9429e3dbe8e470b2eccbd3da39d2f8d8 (diff)
downloadmariadb-git-7fd957411712d2f24f978220615a001cf128410b.tar.gz
bug in libmysql.c:mysql_reconnect() fixed
libmysql/libmysql.c: bug fixed (if mysql_real_connect() failed there were two pointers to malloc'ed strings, with memory corruption on free(), of course)
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index be0c01df000..4a5e534389e 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1572,13 +1572,13 @@ static my_bool mysql_reconnect(MYSQL *mysql)
}
mysql_init(&tmp_mysql);
tmp_mysql.options=mysql->options;
+ bzero((char*) &mysql->options,sizeof(mysql->options));
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag))
DBUG_RETURN(1);
tmp_mysql.free_me=mysql->free_me;
mysql->free_me=0;
- bzero((char*) &mysql->options,sizeof(mysql->options));
mysql_close(mysql);
*mysql=tmp_mysql;
net_clear(&mysql->net);