diff options
author | Christopher Faylor <me@cgf.cx> | 2008-08-27 20:11:11 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-08-27 20:11:11 +0000 |
commit | 25687b0f76a010eecdbbce44aea5b2ba328a537e (patch) | |
tree | ff3c47cbe6ae4b0b7873bec1e4953c94dd3776b6 /winsup/utils/cygcheck.cc | |
parent | 2d8d8175f1188b355dad77080e07ebc202d8cf37 (diff) | |
download | cygnal-25687b0f76a010eecdbbce44aea5b2ba328a537e.tar.gz cygnal-25687b0f76a010eecdbbce44aea5b2ba328a537e.tar.bz2 cygnal-25687b0f76a010eecdbbce44aea5b2ba328a537e.zip |
* cygcheck.cc (nuke): Use malloc rather than alloca for environment variables.
(load_cygwin): Ditto.
* dump_setup.cc (parse_filename): Cosmetic changes.
(get_packages): Ditto.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r-- | winsup/utils/cygcheck.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index fa24f8cf3..0fc27fcd2 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -2003,7 +2003,7 @@ void nuke (char *ev) { int n = 1 + strchr (ev, '=') - ev; - char *s = (char *) alloca (n + 1); + char *s = (char *) malloc (n + 1); memcpy (s, ev, n); s[n] = '\0'; putenv (s); @@ -2051,7 +2051,7 @@ load_cygwin (int& argc, char **&argv) } for (char **ev = envp; *ev; ev++) if (strncmp (*ev, "PATH=", 5) != 0) - putenv (*ev); + putenv (strdup (*ev)); if (path) putenv (path); } |