efipart_inithandles() is missing NULL pointer check

Add missing check of malloc() result.
This commit is contained in:
Toomas Soome 2020-02-20 08:56:56 +00:00
parent ef91a071ac
commit 79cbcdcf3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358160

View File

@ -363,6 +363,8 @@ efipart_inithandles(void)
status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, hin);
if (status == EFI_BUFFER_TOO_SMALL) {
hin = malloc(sz);
if (hin == NULL)
return (ENOMEM);
status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz,
hin);
if (EFI_ERROR(status))