summaryrefslogtreecommitdiff
path: root/fallback.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-12-09 17:21:45 -0500
committerPeter Jones <pjones@redhat.com>2021-12-10 17:08:21 -0500
commitd0df9304c7a777557e1925dc9f75406ec00e6179 (patch)
treec55b6f81b17f39dfe72509425ef648de139c8c56 /fallback.c
parent2e78cd93390f83648a20b5b3bb934f846537e54c (diff)
downloadefi-boot-shim-15.5-rc2.tar.gz
efi-boot-shim-15.5-rc2.zip
Minor coverity fixes15.5-rc2
- one missing free - one minor deadcode issue - two unchecked allocations - one debug hexdump of a variable we just freed Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'fallback.c')
-rw-r--r--fallback.c7
1 files changed, 5 insertions, 2 deletions
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);