mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-07 10:20:09 +00:00
Fix crash due to memory allocation
This commit is contained in:
parent
82a9c9fdb6
commit
4665fcab62
@ -95,7 +95,7 @@ make_full_path(CHAR16 *dirname, CHAR16 *filename, CHAR16 **out, UINT64 *outlen)
|
|||||||
|
|
||||||
len = StrLen(dirname) + StrLen(filename) + StrLen(L"\\EFI\\\\") + 2;
|
len = StrLen(dirname) + StrLen(filename) + StrLen(L"\\EFI\\\\") + 2;
|
||||||
|
|
||||||
CHAR16 *fullpath = AllocateZeroPool(len);
|
CHAR16 *fullpath = AllocateZeroPool(len*sizeof(CHAR16));
|
||||||
if (!fullpath) {
|
if (!fullpath) {
|
||||||
Print(L"Could not allocate memory\n");
|
Print(L"Could not allocate memory\n");
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
@ -286,11 +286,8 @@ add_to_boot_list(EFI_FILE_HANDLE fh, CHAR16 *dirname, CHAR16 *filename, CHAR16 *
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
add_boot_option(dp, fullpath, label, arguments);
|
add_boot_option(dp, fullpath, label, arguments);
|
||||||
FreePool(fullpath);
|
|
||||||
|
|
||||||
err:
|
err:
|
||||||
if (dph)
|
|
||||||
FreePool(dph);
|
|
||||||
if (dpf)
|
if (dpf)
|
||||||
FreePool(dpf);
|
FreePool(dpf);
|
||||||
if (dp)
|
if (dp)
|
||||||
|
Loading…
Reference in New Issue
Block a user