summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/environ.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index da96b5245..4d535e436 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -786,7 +786,8 @@ spenv::retrieve (bool no_envblock, const char *const envname, int len)
/* Make a FOO=BAR entry from the value returned by the cygheap_user
method. */
- p = (cygheap->user.*from_cygheap) ();
+ if (!(p = (cygheap->user.*from_cygheap) ()))
+ return NULL;
int namelen = strlen (name);
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name);