提交 dadc2bdd 编写于 作者: H Heinrich Schuchardt 提交者: Alexander Graf

efi_loader: memory leak in efi_set_variable()

Do not leak native_name if out of memory.

This addresses CoverityScan CID 184095.
Reported-by: NTom Rini <trini@konsulko.com>
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 2c61e0cc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册