Commit 7fd95741 authored by unknown's avatar unknown

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)
parent d320ee1a
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment