mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-29 12:03:03 +00:00
Set errno to ENOMEM for strdup too (due to malloc errno bug)
This commit is contained in:
parent
d44ef39e51
commit
315009a483
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101494
@ -96,8 +96,10 @@ catopen(name, type)
|
||||
strchr(lang, '/') != NULL)
|
||||
lang = "C";
|
||||
|
||||
if ((plang = cptr1 = strdup(lang)) == NULL)
|
||||
if ((plang = cptr1 = strdup(lang)) == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (NLERR);
|
||||
}
|
||||
if ((cptr = strchr(cptr1, '@')) != NULL)
|
||||
*cptr = '\0';
|
||||
pter = pcode = "";
|
||||
@ -118,9 +120,8 @@ catopen(name, type)
|
||||
nlspath = _DEFAULT_NLS_PATH;
|
||||
|
||||
if ((base = cptr = strdup(nlspath)) == NULL) {
|
||||
saverr = errno;
|
||||
free(plang);
|
||||
errno = saverr;
|
||||
errno = ENOMEM;
|
||||
return (NLERR);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user