diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c index e637da23a08..2894709ca03 100644 --- a/stand/efi/libefi/efihttp.c +++ b/stand/efi/libefi/efihttp.c @@ -701,6 +701,8 @@ efihttp_fs_seek(struct open_file *f, off_t offset, int where) return (0); if (where == SEEK_SET && fh->offset < offset) { buf = malloc(1500); + if (buf == NULL) + return (ENOMEM); res = offset - fh->offset; while (res > 0) { err = _efihttp_fs_read(f, buf, min(1500, res), &res2);