diff options
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r-- | winsup/cygwin/cygheap.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index b3d8d6d0a..635480adc 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -244,14 +244,15 @@ _crealloc (void *ptr, unsigned size) inline static void * creturn (cygheap_types x, cygheap_entry * c, unsigned len, const char *fn = NULL) { - if (!c) - if (fn) - api_fatal ("%s would have returned NULL", fn); - else - { - set_errno (ENOMEM); - return NULL; - } + if (c) + /* nothing to do */; + else if (fn) + api_fatal ("%s would have returned NULL", fn); + else + { + set_errno (ENOMEM); + return NULL; + } c->type = x; char *cend = ((char *) c + sizeof (*c) + len); if (cygheap_max < cend) |