summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 3e5ceb1a738..f8d52e02196 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -402,7 +402,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
HANDLE handle_file_map = NULL;
ulong connect_number;
char connect_number_char[22], *p;
- char tmp[64];
+ char *tmp= NULL;
char *suffix_pos;
DWORD error_allow = 0;
DWORD error_code = 0;
@@ -410,6 +410,12 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
char *shared_memory_base_name = mysql->options.shared_memory_base_name;
/*
+ 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))))
+ goto err;
+
+ /*
The name of event and file-mapping events create agree next rule:
shared_memory_base_name+unique_part
Where:
@@ -551,6 +557,8 @@ err2:
CloseHandle(handle_file_map);
}
err:
+ if (tmp)
+ my_free(tmp, MYF(0));
if (error_allow)
error_code = GetLastError();
if (event_connect_request)