mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
efi_loader: memory leak in efi_set_variable()
Do not leak native_name if out of memory. This addresses CoverityScan CID 184095. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
2c61e0cc5c
commit
dadc2bddb0
1 changed files with 4 additions and 2 deletions
|
@ -294,8 +294,10 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor,
|
||||||
}
|
}
|
||||||
|
|
||||||
val = malloc(2 * data_size + strlen("{ro,run,boot}(blob)") + 1);
|
val = malloc(2 * data_size + strlen("{ro,run,boot}(blob)") + 1);
|
||||||
if (!val)
|
if (!val) {
|
||||||
return EFI_EXIT(EFI_OUT_OF_RESOURCES);
|
ret = EFI_OUT_OF_RESOURCES;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
s = val;
|
s = val;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue