Skip to content

Commit 6a1d1a9

Browse files
rosslagerwallvathpela
authored andcommitted
loader-protocol: Fix memory leaks
This may happen if the image is loaded and then unloaded without calling StartImage(). Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
1 parent 121cddf commit 6a1d1a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

loader-proto.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ shim_unload_image(EFI_HANDLE ImageHandle)
419419

420420
flush_cached_sections(ImageHandle);
421421
free_pages_alloc_image(image);
422+
if (image->li.FilePath)
423+
BS->FreePool(image->li.FilePath);
424+
if (image->loaded_image_device_path)
425+
BS->FreePool(image->loaded_image_device_path);
422426
FreePool(image);
423427

424428
return EFI_SUCCESS;

0 commit comments

Comments
 (0)