mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-14 18:05:45 +00:00
shim: fix resource leak on should_use_fallback() error path
ExitBootServices() and Exit() should both clean these up anyway, but we should do the right thing nonetheless. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
7cb2179b53
commit
4794822464
10
shim.c
10
shim.c
@ -1270,8 +1270,8 @@ should_use_fallback(EFI_HANDLE image_handle)
|
|||||||
unsigned int pathlen = 0;
|
unsigned int pathlen = 0;
|
||||||
CHAR16 *bootpath = NULL;
|
CHAR16 *bootpath = NULL;
|
||||||
EFI_FILE_IO_INTERFACE *fio = NULL;
|
EFI_FILE_IO_INTERFACE *fio = NULL;
|
||||||
EFI_FILE *vh;
|
EFI_FILE *vh = NULL;
|
||||||
EFI_FILE *fh;
|
EFI_FILE *fh = NULL;
|
||||||
EFI_STATUS rc;
|
EFI_STATUS rc;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
@ -1322,11 +1322,13 @@ should_use_fallback(EFI_HANDLE image_handle)
|
|||||||
uefi_call_wrapper(vh->Close, 1, vh);
|
uefi_call_wrapper(vh->Close, 1, vh);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
uefi_call_wrapper(fh->Close, 1, fh);
|
|
||||||
uefi_call_wrapper(vh->Close, 1, vh);
|
|
||||||
|
|
||||||
ret = 1;
|
ret = 1;
|
||||||
error:
|
error:
|
||||||
|
if (fh)
|
||||||
|
uefi_call_wrapper(fh->Close, 1, fh);
|
||||||
|
if (vh)
|
||||||
|
uefi_call_wrapper(vh->Close, 1, vh);
|
||||||
if (bootpath)
|
if (bootpath)
|
||||||
FreePool(bootpath);
|
FreePool(bootpath);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user