]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug introduced when removing the SafeFreePool. Pointer should be checked before...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 31 Oct 2008 06:35:23 +0000 (06:35 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 31 Oct 2008 06:35:23 +0000 (06:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6349 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/GenericBdsLib/BdsMisc.c

index 994f90ed0d81c6e81a8c6d10211b6e902fb0a5ca..3136341162cd74ae81edb1e24a055c5d5d409334 100644 (file)
@@ -305,7 +305,9 @@ BdsLibRegisterNewOption (
         // Got the option, so just return\r
         //\r
         FreePool (OptionPtr);\r
-        FreePool (TempOptionPtr);\r
+        if (TempOptionPtr != NULL) {\r
+          FreePool (TempOptionPtr);\r
+        }\r
         return EFI_SUCCESS;\r
       } else {\r
         //\r
@@ -364,7 +366,9 @@ BdsLibRegisterNewOption (
   //\r
   if (EFI_ERROR (Status) || UpdateDescription) {\r
     FreePool (OptionPtr);\r
-    FreePool (TempOptionPtr);\r
+    if (TempOptionPtr != NULL) {\r
+      FreePool (TempOptionPtr);\r
+    }\r
     return Status;\r
   }\r
 \r
@@ -386,7 +390,9 @@ BdsLibRegisterNewOption (
                     sizeof (UINT16),\r
                     &BootOrderEntry\r
                     );\r
-    FreePool (TempOptionPtr);\r
+    if (TempOptionPtr != NULL) {\r
+      FreePool (TempOptionPtr);\r
+    }\r
     return Status;\r
   }\r
 \r