]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
Parameter checking in BdsLibMatchDevicePaths() is wrong. This bug was found because...
[mirror_edk2.git] / MdeModulePkg / Library / GenericBdsLib / BdsMisc.c
index 994f90ed0d81c6e81a8c6d10211b6e902fb0a5ca..8b3dcd783b8d60b63124719d7c859a69dea8c93d 100644 (file)
@@ -364,7 +364,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 +388,9 @@ BdsLibRegisterNewOption (
                     sizeof (UINT16),\r
                     &BootOrderEntry\r
                     );\r
-    FreePool (TempOptionPtr);\r
+    if (TempOptionPtr != NULL) {\r
+      FreePool (TempOptionPtr);\r
+    }\r
     return Status;\r
   }\r
 \r
@@ -756,7 +760,7 @@ BdsLibMatchDevicePaths (
   EFI_DEVICE_PATH_PROTOCOL  *DevicePathInst;\r
   UINTN                     Size;\r
 \r
-  if (Multi != NULL || Single  != NULL) {\r
+  if (Multi == NULL || Single  == NULL) {\r
     return FALSE;\r
   }\r
 \r