The patch is needed, but I forgot to include malloc.h, I'll send a v2 later

Thanks
/Ilias

On Thu, 7 Dec 2023 at 11:20, Ilias Apalodimas
<[email protected]> wrote:
>
> efi_get_var() allocates memory which has to be freed after the value of
> the variable is consumed. Free the memory properly
>
> Fixes: f2bfa0cb1794 ("bootstd: Make efi_mgr bootmeth work for non-sandbox 
> setups")
> Signed-off-by: Ilias Apalodimas <[email protected]>
> ---
>  boot/bootmeth_efi_mgr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c
> index e6c42d41fb80..530ad09cce83 100644
> --- a/boot/bootmeth_efi_mgr.c
> +++ b/boot/bootmeth_efi_mgr.c
> @@ -65,6 +65,7 @@ static int efi_mgr_read_bootflow(struct udevice *dev, 
> struct bootflow *bflow)
>         bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid,
>                                 &size);
>         if (bootorder) {
> +               free(bootorder);
>                 bflow->state = BOOTFLOWST_READY;
>                 return 0;
>         }
> --
> 2.40.1
>

Reply via email to