fix cmdline use-after-free bug

This commit is contained in:
a1ive 2023-06-19 10:34:34 +08:00
parent 746aa67ca3
commit 4c89e48ea6
No known key found for this signature in database
GPG Key ID: 03D21C458E568F05

View File

@ -301,7 +301,6 @@ EFI_STATUS EFIAPI efi_main (EFI_HANDLE image_handle,EFI_SYSTEM_TABLE *systab)
/* Process command line */
process_cmdline (cmdline);
efi_free (cmdline);
DBG ("systab=%p image_handle=%p\n", systab, image_handle);
if (nt_cmdline->initrd_path)
efi_load_sfs_initrd (loaded->DeviceHandle, &initrd, &initrd_len);
@ -315,6 +314,7 @@ EFI_STATUS EFIAPI efi_main (EFI_HANDLE image_handle,EFI_SYSTEM_TABLE *systab)
extract_initrd (initrd, initrd_len);
efi_free (cmdline);
if (! bootmgr)
die ("FATAL: no bootmgfw.efi\n");