mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
Oops! don't set errno to ENOMEM explicitly if malloc() failed.
Found by: ache
This commit is contained in:
parent
ba20acfdb2
commit
316321ebdf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65472
@ -259,13 +259,17 @@ catclose( catd)
|
|||||||
|
|
||||||
/* Note that only malloc failures are allowed to return an error */
|
/* Note that only malloc failures are allowed to return an error */
|
||||||
static char* _errowner = "Message Catalog System";;
|
static char* _errowner = "Message Catalog System";;
|
||||||
#define PROBLEM(err, msg) { \
|
#define CORRUPT() { \
|
||||||
fprintf(stderr, msg, _errowner); \
|
fprintf(stderr, "%s: currupt file.", _errowner); \
|
||||||
free(cat); \
|
free(cat); \
|
||||||
NLRETERR(err); \
|
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
|
static void
|
||||||
__nls_free_resources(cat, i)
|
__nls_free_resources(cat, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user