From e34fe8a408efb852df39ddb775cff71d86b3db3a Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 12 Aug 2002 17:14:04 +0000 Subject: [PATCH] Now malloc() is fixed, remove errno hardcoding to ENOMEM --- lib/libc/locale/collate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index c7e6c12d8d4d..44c3eb720298 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -92,23 +92,26 @@ __collate_load_tables(const char *encoding) if ((TMP_substitute_table = malloc(sizeof(__collate_substitute_table))) == NULL) { + saverr = errno; (void)fclose(fp); - errno = ENOMEM; + errno = saverr; return (_LDP_ERROR); } if ((TMP_char_pri_table = malloc(sizeof(__collate_char_pri_table))) == NULL) { + saverr = errno; free(TMP_substitute_table); (void)fclose(fp); - errno = ENOMEM; + errno = saverr; return (_LDP_ERROR); } if ((TMP_chain_pri_table = malloc(sizeof(__collate_chain_pri_table))) == NULL) { + saverr = errno; free(TMP_substitute_table); free(TMP_char_pri_table); (void)fclose(fp); - errno = ENOMEM; + errno = saverr; return (_LDP_ERROR); }