From 11252121f853a0a3aac102b72a279204b9c69a00 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Thu, 29 Feb 2024 16:56:08 +0000 Subject: Fix leak in error path Signed-off-by: Ross Lagerwall --- shim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shim.c') diff --git a/shim.c b/shim.c index 68456656..9c43f6b8 100644 --- a/shim.c +++ b/shim.c @@ -1498,8 +1498,10 @@ load_cert_file(EFI_HANDLE image_handle, CHAR16 *filename, CHAR16 *PathName) return efi_status; efi_status = verify_image(data, datasize, shim_li, &context); - if (EFI_ERROR(efi_status)) + if (EFI_ERROR(efi_status)) { + FreePool(data); return efi_status; + } Section = context.FirstSection; for (i = 0; i < context.NumberOfSections; i++, Section++) { -- cgit v1.2.3