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

This commit is contained in:
ache 2002-08-12 17:14:04 +00:00
parent d4778abafa
commit 9001814d5d

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