]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Minor code enhancement.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 18 Jan 2010 07:20:22 +0000 (07:20 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 18 Jan 2010 07:20:22 +0000 (07:20 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9792 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c

index 7a9756e1f1d10dd2477e8e251cf8264ecc2ef414..e6b2fe4d17cf6539a042ac9cc5f8fe4f8115a535 100644 (file)
@@ -567,7 +567,9 @@ BdsExpandPartitionPartialDevicePathToFull (
 \r
           TempNewDevicePath = CachedDevicePath;\r
           CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
-          FreePool(TempNewDevicePath);\r
+          if (TempNewDevicePath != NULL) {\r
+            FreePool(TempNewDevicePath);\r
+          }\r
         } else {\r
           TempNewDevicePath = CachedDevicePath;\r
           CachedDevicePath = AppendDevicePathInstance (BlockIoDevicePath, CachedDevicePath);\r
@@ -616,7 +618,9 @@ BdsExpandPartitionPartialDevicePathToFull (
     }\r
   }\r
 \r
-  FreePool (CachedDevicePath);\r
+  if (CachedDevicePath != NULL) {\r
+    FreePool (CachedDevicePath);\r
+  }\r
   if (BlockIoBuffer != NULL) {\r
     FreePool (BlockIoBuffer);\r
   }\r