Skip to content
Snippets Groups Projects
Commit 3a8ad050 authored by Ilias Apalodimas's avatar Ilias Apalodimas Committed by Heinrich Schuchardt
Browse files

efi_loader: fix memory freeing in efi_get_dp_from_boot()


efi_get_var() allocates memory which must be freed after the variable is
used. Since the device path is duplicated after we deserialize the load
options free the memory used for the variable payload

Fixes: db61e70e efi_loader: efi_dp_from_lo() should skip VenMedia node
Signed-off-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: default avatarHeinric Schuchardt <heinrich.schuchardt@canonical.com>
parent a4817406
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,7 @@ out:
*/
struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t *guid)
{
struct efi_device_path *file_path = NULL;
struct efi_load_option lo;
void *var_value;
efi_uintn_t size;
......@@ -92,11 +93,11 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t *guid)
if (ret != EFI_SUCCESS)
goto err;
return efi_dp_from_lo(&lo, guid);
file_path = efi_dp_from_lo(&lo, guid);
err:
free(var_value);
return NULL;
return file_path;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment