diff options
author | Peter Jones <pjones@redhat.com> | 2021-12-09 17:21:45 -0500 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2021-12-10 17:08:21 -0500 |
commit | d0df9304c7a777557e1925dc9f75406ec00e6179 (patch) | |
tree | c55b6f81b17f39dfe72509425ef648de139c8c56 /fallback.c | |
parent | 2e78cd93390f83648a20b5b3bb934f846537e54c (diff) | |
download | efi-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |