aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efi_loader/efi_memory.c')
-rw-r--r--lib/efi_loader/efi_memory.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 45d3bf52b8..ebf4a2d5fa 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -324,6 +324,7 @@ static efi_status_t efi_add_memory_map_pg(u64 start, u64 pages,
* The user requested to only have RAM overlaps,
* but we hit a non-RAM region. Error out.
*/
+ free(newlist);
return EFI_NO_MAPPING;
case EFI_CARVE_NO_OVERLAP:
/* Just ignore this list entry */
@@ -354,6 +355,7 @@ static efi_status_t efi_add_memory_map_pg(u64 start, u64 pages,
* The payload wanted to have RAM overlaps, but we overlapped
* with an unallocated region. Error out.
*/
+ free(newlist);
return EFI_NO_MAPPING;
}