]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
smbiosview - add user input verification.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / HexEdit / DiskImage.c
index 140db71671247678478d3dfa7747152b3763e5df..86db6aadf25edebcac67209b85ac3be749b16d15 100644 (file)
@@ -219,6 +219,7 @@ Returns:
 {\r
   CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL        *DupDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL        *DupDevicePathForFree;\r
   EFI_HANDLE                      Handle;\r
   EFI_BLOCK_IO_PROTOCOL           *BlkIo;\r
   EFI_STATUS                      Status;\r
@@ -241,11 +242,12 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
   DupDevicePath = DuplicateDevicePath(DevicePath);\r
+  DupDevicePathForFree = DupDevicePath;\r
   //\r
   // get blkio interface\r
   //\r
   Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);\r
-  FreePool(DupDevicePath);\r
+  FreePool(DupDevicePathForFree);\r
   if (EFI_ERROR (Status)) {\r
     StatusBarSetStatusString (L"Read Disk Failed");\r
     return Status;\r