aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/mach-startup
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-08 11:23:34 +0000
committermarha <marha@users.sourceforge.net>2009-12-08 11:23:34 +0000
commit75d2bbcf0f39b9c85bc270728343f61dabebce2d (patch)
treecc3c92e0383bc1ed885d25290167c46b1f9edb15 /xorg-server/hw/xquartz/mach-startup
parent3e1ba549192a68801232c28a9c12defb59531654 (diff)
downloadvcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.tar.gz
vcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.tar.bz2
vcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.zip
Git update 8/12/2009
Diffstat (limited to 'xorg-server/hw/xquartz/mach-startup')
-rw-r--r--xorg-server/hw/xquartz/mach-startup/stub.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/xorg-server/hw/xquartz/mach-startup/stub.c b/xorg-server/hw/xquartz/mach-startup/stub.c
index af1c59efb..c8686e78f 100644
--- a/xorg-server/hw/xquartz/mach-startup/stub.c
+++ b/xorg-server/hw/xquartz/mach-startup/stub.c
@@ -306,12 +306,12 @@ int main(int argc, char **argv, char **envp) {
/* We have fixed-size string lengths due to limitations in IPC,
* so we need to copy our argv and envp.
*/
- newargv = (string_array_t)alloca(argc * sizeof(string_t));
- newenvp = (string_array_t)alloca(envpc * sizeof(string_t));
-
+ newargv = (string_array_t)malloc(argc * sizeof(string_t));
+ newenvp = (string_array_t)malloc(envpc * sizeof(string_t));
+
if(!newargv || !newenvp) {
fprintf(stderr, "Xquartz: Memory allocation failure\n");
- exit(EXIT_FAILURE);
+ return EXIT_FAILURE;
}
for(i=0; i < argc; i++) {
@@ -322,6 +322,10 @@ int main(int argc, char **argv, char **envp) {
}
kr = start_x11_server(mp, newargv, argc, newenvp, envpc);
+
+ free(newargv);
+ free(newenvp);
+
if (kr != KERN_SUCCESS) {
fprintf(stderr, "Xquartz: start_x11_server: %s\n", mach_error_string(kr));
return EXIT_FAILURE;