summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-08-31 10:01:13 -0700
committerTatiana A. Nurnberg <azundris@mysql.com>2009-08-31 10:01:13 -0700
commitc3aac11c088b375b0bbeabacb4d27e40261dabaf (patch)
tree2d0569e8720c8be597ca56d2904c157d37c7023f /sql-common
parent2217de25139f5994fc1c5c71f897ff0788813db0 (diff)
downloadmariadb-git-c3aac11c088b375b0bbeabacb4d27e40261dabaf.tar.gz
Bug#35132: MySQLadmin --wait ping always crashes on Windows systems
Failing to connect would release parts of the MYSQL struct. We would then proceed to try again to connect without re- initializing the struct. We prevent the unwanted freeing of data we'll still need now.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 8f1f4a1fd5a..89de74ebd58 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -417,6 +417,15 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
int i;
/*
+ If this is NULL, somebody freed the MYSQL* options. mysql_close()
+ is a good candidate. We don't just silently (re)set it to
+ def_shared_memory_base_name as that would create really confusing/buggy
+ behavior if the user passed in a different name on the command-line or
+ in a my.cnf.
+ */
+ DBUG_ASSERT(shared_memory_base_name != NULL);
+
+ /*
get enough space base-name + '_' + longest suffix we might ever send
*/
if (!(tmp= (char *)my_malloc(strlen(shared_memory_base_name) + 32L, MYF(MY_FAE))))