From d0df9304c7a777557e1925dc9f75406ec00e6179 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Dec 2021 17:21:45 -0500 Subject: Minor coverity fixes - one missing free - one minor deadcode issue - two unchecked allocations - one debug hexdump of a variable we just freed Signed-off-by: Peter Jones --- fallback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fallback.c') diff --git a/fallback.c b/fallback.c index 5da867dd..8e6327be 100644 --- a/fallback.c +++ b/fallback.c @@ -230,8 +230,11 @@ add_boot_option(EFI_DEVICE_PATH *hddp, EFI_DEVICE_PATH *fulldp, StrLen(label)*2 + 2 + DevicePathSize(hddp) + StrLen(arguments) * 2; - CHAR8 *data = AllocateZeroPool(size + 2); - CHAR8 *cursor = data; + CHAR8 *data, *cursor; + cursor = data = AllocateZeroPool(size + 2); + if (!data) + return EFI_OUT_OF_RESOURCES; + *(UINT32 *)cursor = LOAD_OPTION_ACTIVE; cursor += sizeof (UINT32); *(UINT16 *)cursor = DevicePathSize(hddp); -- cgit v1.2.3