We don't need to set ENOMEM on failure of those functions.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
buflen = BUFLEN;
buf = MALLOC(buflen, char);
- if (NULL == buf) {
- goto cleanup_ENOMEM;
- }
+ if (NULL == buf)
+ goto cleanup_errno;
while (db->ops->fgets (buf, buflen, db->fp) == buf) {
char *cp;
buflen += BUFLEN;
buf = REALLOCF(buf, buflen, char);
- if (NULL == buf) {
- goto cleanup_ENOMEM;
- }
+ if (NULL == buf)
+ goto cleanup_errno;
+
len = strlen (buf);
if (db->ops->fgets (buf + len,
(int) (buflen - len),
free (line);
cleanup_buf:
free (buf);
- cleanup_ENOMEM:
errno = ENOMEM;
cleanup_errno:
saved_errno = errno;