Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-09-16 18:52:32 +0400
committerChristopher Faylor <me@cgf.cx>2005-09-16 18:52:32 +0400
commit4dc2cfe588b87a2eab01f1a0b8369832f53b61c3 (patch)
tree6f9f854d8f3335d9ce20a572b35aaec40f19aa74 /winsup/cygwin/environ.cc
parent882dfbf776f69b39aeb5f444525191327fb3a3d9 (diff)
* environ.cc (environ_init): Issue an error if GetEnvironmentStrings fails and
return.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 37d950ee0..4029cd624 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -752,7 +752,13 @@ environ_init (char **envp, int envc)
/* Allocate space for environment + trailing NULL + CYGWIN env. */
lastenviron = envp = (char **) malloc ((4 + (envc = 100)) * sizeof (char *));
+
rawenv = GetEnvironmentStrings ();
+ if (!rawenv)
+ {
+ system_printf ("GetEnvironmentStrings returned NULL, %E");
+ return;
+ }
/* Current directory information is recorded as variables of the
form "=X:=X:\foo\bar; these must be changed into something legal