mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-28 00:11:32 +00:00
bootstd: Fix a memory leak in the efi manager bootflow
efi_get_var() allocates memory which has to be freed after the value of
the variable is consumed. Free the memory properly
Fixes: f2bfa0cb17
("bootstd: Make efi_mgr bootmeth work for non-sandbox setups")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
This commit is contained in:
parent
09a17b0d01
commit
eb09c33084
1 changed files with 2 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <efi_loader.h>
|
#include <efi_loader.h>
|
||||||
#include <efi_variable.h>
|
#include <efi_variable.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct efi_mgr_priv - private info for the efi-mgr driver
|
* struct efi_mgr_priv - private info for the efi-mgr driver
|
||||||
|
@ -65,6 +66,7 @@ static int efi_mgr_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||||
bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid,
|
bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid,
|
||||||
&size);
|
&size);
|
||||||
if (bootorder) {
|
if (bootorder) {
|
||||||
|
free(bootorder);
|
||||||
bflow->state = BOOTFLOWST_READY;
|
bflow->state = BOOTFLOWST_READY;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue