summaryrefslogtreecommitdiff
path: root/sql/mini_client.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-12-09 14:28:51 -0700
committerunknown <sasha@mysql.sashanet.com>2000-12-09 14:28:51 -0700
commit8beb43501be6bb4a4bd09e2b0aadc815dcc2f606 (patch)
treee1d361e164277c92682635c15be624dce98c7c72 /sql/mini_client.cc
parent701af104149fc90dc61267a0dc0f67694c8ac40b (diff)
downloadmariadb-git-8beb43501be6bb4a4bd09e2b0aadc815dcc2f606.tar.gz
fixed up leaks found by --exit-info=256
better error diagnostic in SLAVE START sql/mini_client.cc: if we fail to connect, we need to free the inited structure sql/mysqld.cc: added end_slave() for slave cleanup sql/slave.cc: fixed serveral memory leaks sql/slave.h: added end_master_info() for clean up sql/sql_class.cc: not changed sql/sql_repl.cc: initialize master info before creating slave thread in SLAVE START - this way we can easily send an error to the client if something is wrong in init_master_info
Diffstat (limited to 'sql/mini_client.cc')
-rw-r--r--sql/mini_client.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 3520062e052..11b0b111ec4 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -386,7 +386,10 @@ my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql)
if (!mc_mysql_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag))
- DBUG_RETURN(1);
+ {
+ mc_mysql_close(&tmp_mysql);
+ DBUG_RETURN(1);
+ }
tmp_mysql.free_me=mysql->free_me;
mysql->free_me=0;
bzero((char*) &mysql->options,sizeof(&mysql->options));