insert_zfs() is missing NULL pointer check
Add missing check of malloc() result.
This commit is contained in:
parent
79cbcdcf3e
commit
7afa0d95e2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user