Now malloc() is fixed, remove errno hardcoding to ENOMEM

This commit is contained in:
Andrey A. Chernov 2002-08-12 17:14:04 +00:00
parent 5c5384fe80
commit e34fe8a408

View File

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