aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2020-02-20 09:00:20 +0000
committerToomas Soome <tsoome@FreeBSD.org>2020-02-20 09:00:20 +0000
commit7afa0d95e212a612b2990c975082757c44c3b50f (patch)
tree9bd27d4b2cf2920b25938da055b5707fa86a00cd
parent79cbcdcf3ececdb45f02c528d00e53e9600a4f48 (diff)
downloadsrc-7afa0d95e212a612b2990c975082757c44c3b50f.tar.gz
src-7afa0d95e212a612b2990c975082757c44c3b50f.zip
insert_zfs() is missing NULL pointer check
Add missing check of malloc() result.
Notes
Notes: svn path=/head/; revision=358162
-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