Oops! don't set errno to ENOMEM explicitly if malloc() failed.

Found by:	ache
This commit is contained in:
Alexey Zelkin 2000-09-05 12:23:08 +00:00
parent ba20acfdb2
commit 316321ebdf

View File

@ -259,13 +259,17 @@ catclose( catd)
/* Note that only malloc failures are allowed to return an error */
static char* _errowner = "Message Catalog System";;
#define PROBLEM(err, msg) { \
fprintf(stderr, msg, _errowner); \
free(cat); \
NLRETERR(err); \
#define CORRUPT() { \
fprintf(stderr, "%s: currupt file.", _errowner); \
free(cat); \
NLRETERR(EINVAL); \
}
#define NOSPACE() { \
fprintf(stderr, "%s: no more memory.", _errowner); \
free(cat); \
return(NLERR); \
}
#define CORRUPT() PROBLEM(EINVAL, "%s: corrupt file.\n")
#define NOSPACE() PROBLEM(ENOMEM, "%s: no more memory.\n")
static void
__nls_free_resources(cat, i)