diff options
author | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
commit | 0540eb5a1f795c0f5265d244ec979b8ddfcf3acb (patch) | |
tree | 06c5c3f4394f2d6d48c95ed1bfbab3a44e9996cc /xorg-server/hw/xquartz/mach-startup | |
parent | 5c72c54bc068bf12007dc15b353b1b2795e9aaf5 (diff) | |
parent | 75d2bbcf0f39b9c85bc270728343f61dabebce2d (diff) | |
download | vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.gz vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.bz2 vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.zip |
svn merge ^/trunk .
Diffstat (limited to 'xorg-server/hw/xquartz/mach-startup')
-rw-r--r-- | xorg-server/hw/xquartz/mach-startup/stub.c | 12 |
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; |