Signed-off-by: Peter Jones <pjones@redhat.com>
ssize_t s = 0;
uint8_t *newbuf;
- if (!(newbuf = calloc(size, sizeof (uint8_t))))
+ if (!(newbuf = calloc(size, sizeof (uint8_t)))) {
+ efi_error("could not allocate memory");
return -1;
+ }
*buf = newbuf;
do {
*buf = NULL;
*bufsize = 0;
errno = saved_errno;
+ efi_error("could not read from file");
return -1;
}
filesize += s;
*buf = NULL;
*bufsize = 0;
errno = ENOMEM;
+ efi_error("could not read from file");
return -1;
}
newbuf = realloc(*buf, size + 4096);
*buf = NULL;
*bufsize = 0;
errno = saved_errno;
+ efi_error("could not allocate memory");
return -1;
}
*buf = newbuf;
if (!newbuf) {
free(*buf);
*buf = NULL;
+ efi_error("could not allocate memory");
return -1;
}
newbuf[filesize] = '\0';