summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-10-02 05:30:05 +0200
committerAlexander Graf <agraf@suse.de>2018-10-16 16:40:11 +0200
commitdadc2bddb0c0e00554666ec39bc10b9d66409f24 (patch)
treee258749afba98284f85aa0ff22eb96ab24a1d593 /lib/efi_loader
parent2c61e0cc5c67345d2d3e4a66f6e22899afa381cc (diff)
downloadu-boot-dadc2bddb0c0e00554666ec39bc10b9d66409f24.tar.gz
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>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_variable.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index a1313fa215..19d9cb865f 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -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);
- if (!val)
- return EFI_EXIT(EFI_OUT_OF_RESOURCES);
+ if (!val) {
+ ret = EFI_OUT_OF_RESOURCES;
+ goto out;
+ }
s = val;