aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stand/efi/libefi/efizfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/stand/efi/libefi/efizfs.c b/stand/efi/libefi/efizfs.c
index 8b28250f109b..aedb9c2294cd 100644
--- a/stand/efi/libefi/efizfs.c
+++ b/stand/efi/libefi/efizfs.c
@@ -86,9 +86,11 @@ insert_zfs(EFI_HANDLE handle, uint64_t guid)
zfsinfo_t *zi;
zi = malloc(sizeof(zfsinfo_t));
- zi->zi_handle = handle;
- zi->zi_pool_guid = guid;
- STAILQ_INSERT_TAIL(&zfsinfo, zi, zi_link);
+ if (zi != NULL) {
+ zi->zi_handle = handle;
+ zi->zi_pool_guid = guid;
+ STAILQ_INSERT_TAIL(&zfsinfo, zi, zi_link);
+ }
}
void