diff options
| author | Gary Ching-Pang Lin <glin@suse.com> | 2013-04-30 11:58:51 +0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-04-30 09:46:23 -0400 |
| commit | 4665fcab6216c593b3e37e035697a53101615558 (patch) | |
| tree | 772abaab7c6117ad670d1216ff30fc5ece650fea | |
| parent | 82a9c9fdb6a66505dcc9627a5db8a7014c97f0c0 (diff) | |
| download | efi-boot-shim-4665fcab6216c593b3e37e035697a53101615558.tar.gz efi-boot-shim-4665fcab6216c593b3e37e035697a53101615558.zip | |
Fix crash due to memory allocation
| -rw-r--r-- | fallback.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -95,7 +95,7 @@ make_full_path(CHAR16 *dirname, CHAR16 *filename, CHAR16 **out, UINT64 *outlen) len = StrLen(dirname) + StrLen(filename) + StrLen(L"\\EFI\\\\") + 2; - CHAR16 *fullpath = AllocateZeroPool(len); + CHAR16 *fullpath = AllocateZeroPool(len*sizeof(CHAR16)); if (!fullpath) { Print(L"Could not allocate memory\n"); return EFI_OUT_OF_RESOURCES; @@ -286,11 +286,8 @@ add_to_boot_list(EFI_FILE_HANDLE fh, CHAR16 *dirname, CHAR16 *filename, CHAR16 * #endif add_boot_option(dp, fullpath, label, arguments); - FreePool(fullpath); err: - if (dph) - FreePool(dph); if (dpf) FreePool(dpf); if (dp) |
