Set errno to ENOMEM for strdup too (due to malloc errno bug)

This commit is contained in:
ache 2002-08-07 23:52:28 +00:00
parent 50ff7d4374
commit 586a522666

View File

@ -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);
}