]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make sure out of memory error is correctly signaled.
authorUlrich Drepper <drepper@redhat.com>
Sat, 5 Apr 1997 00:46:10 +0000 (00:46 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 5 Apr 1997 00:46:10 +0000 (00:46 +0000)
nss/getXXbyYY.c
nss/getXXent.c

index 542072be25390714867d39622fa136ee40786997..f81df0538165862aea628e5ef0cb3acf331f4db6 100644 (file)
@@ -122,6 +122,9 @@ FUNCTION_NAME (ADD_PARAMS)
       buffer = new_buf;
     }
 
+  if (buffer == NULL)
+    result = NULL;
+
 #ifdef HANDLE_DIGITS_DOTS
 done:
 #endif
index f180171150f29c96200911f0fceee6cf9af17bd9..eeb03dfa37c56347d3ebc69a59c094c3b2f655c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -69,7 +69,7 @@ GETFUNC_NAME (void)
   static char *buffer;
   static size_t buffer_size;
   static LOOKUP_TYPE resbuf;
-  LOOKUP_TYPE *result = NULL;
+  LOOKUP_TYPE *result;
   int save;
 
   /* Get lock.  */
@@ -103,6 +103,9 @@ GETFUNC_NAME (void)
       buffer = new_buf;
     }
 
+  if (buffer == NULL)
+    result = NULL;
+
   /* Release lock.  Preserve error value.  */
   save = errno;
   __libc_lock_unlock (lock);