On 17.08.21 12:35, Christian Storm wrote:
> From: Christian Storm <[email protected]>
> 
> File handle tmp is Open()'d but not Close()'d on the Read()
> error condition path, resulting in a file handle leak.
> Fix it by calling Close() on this error exit path.
> 
> Signed-off-by: Christian Storm <[email protected]>
> ---
>  utils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/utils.c b/utils.c
> index 42ff741..80801b7 100644
> --- a/utils.c
> +++ b/utils.c
> @@ -94,6 +94,7 @@ CHAR16 *get_volume_custom_label(EFI_FILE_HANDLE fh)
>       }
>       status = uefi_call_wrapper(tmp->Read, 3, tmp, &buffsize, buffer);
>       if (status != EFI_SUCCESS) {
> +             (VOID)uefi_call_wrapper(fh->Close, 1, tmp);
>               (VOID)FreePool(buffer);
>               return NULL;
>       }
> 

Thanks, merged.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/620c0780-4c8d-0e79-ba21-14bca78aab07%40siemens.com.

Reply via email to