svn commit: r358162 - head/stand/efi/libefi
Toomas Soome
tsoome at FreeBSD.org
Thu Feb 20 09:00:21 UTC 2020
Author: tsoome
Date: Thu Feb 20 09:00:20 2020
New Revision: 358162
URL: https://svnweb.freebsd.org/changeset/base/358162
Log:
insert_zfs() is missing NULL pointer check
Add missing check of malloc() result.
Modified:
head/stand/efi/libefi/efizfs.c
Modified: head/stand/efi/libefi/efizfs.c
==============================================================================
--- head/stand/efi/libefi/efizfs.c Thu Feb 20 08:58:09 2020 (r358161)
+++ head/stand/efi/libefi/efizfs.c Thu Feb 20 09:00:20 2020 (r358162)
@@ -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
More information about the svn-src-head
mailing list