summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/mysqlmanager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index 3a95b4e9a49..92f76ac4218 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -1543,10 +1543,11 @@ static struct manager_exec* manager_exec_new(char* arg_start,char* arg_end)
tmp->error="Too few arguments";
return tmp;
}
- tmp->data_buf=(char*)tmp+sizeof(*tmp);
+ /* We have to allocate 'args' first as this must be alligned */
+ tmp->args=(char**)(tmp +1);
+ tmp->data_buf= (char*) (tmp->args + num_args);
memcpy(tmp->data_buf,arg_start,arg_len);
tmp->data_buf_size=arg_len;
- tmp->args=(char**)(tmp->data_buf+arg_len);
tmp->num_args=num_args;
tmp->ident=tmp->data_buf;
tmp->ident_len=strlen(tmp->ident);