From: Ulrich Drepper Date: Sat, 5 Apr 1997 00:46:10 +0000 (+0000) Subject: Make sure out of memory error is correctly signaled. X-Git-Tag: cvs/libc20x-ud-970404~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c075fbc99c91c7b3c5da333d8eeb4e044792ff94;p=thirdparty%2Fglibc.git Make sure out of memory error is correctly signaled. --- diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c index 542072be253..f81df053816 100644 --- a/nss/getXXbyYY.c +++ b/nss/getXXbyYY.c @@ -122,6 +122,9 @@ FUNCTION_NAME (ADD_PARAMS) buffer = new_buf; } + if (buffer == NULL) + result = NULL; + #ifdef HANDLE_DIGITS_DOTS done: #endif diff --git a/nss/getXXent.c b/nss/getXXent.c index f180171150f..eeb03dfa37c 100644 --- a/nss/getXXent.c +++ b/nss/getXXent.c @@ -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);