]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: fix two instances of FreePool () on NULL value
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 27 Mar 2015 17:27:24 +0000 (17:27 +0000)
committerlersek <lersek@Edk2>
Fri, 27 Mar 2015 17:27:24 +0000 (17:27 +0000)
This is a copy/paste of the exact same code in both cases: Buffer
should only be freed on the success path, otherwise it will be
NULL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17078 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Bds/Bds.c
ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c

index 971ab07524d70c22e681adff479c5d6638bc08f9..6a12717a1c12c96f4b0d9dc5b9368566564fcbf4 100644 (file)
@@ -155,8 +155,8 @@ InitializeConsolePipe (
       *Handle = Buffer[0];\r
       Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
       ASSERT_EFI_ERROR(Status);\r
+      FreePool (Buffer);\r
     }\r
-    FreePool (Buffer);\r
   } else {\r
     Status = EFI_SUCCESS;\r
   }\r
index c07fc0f607d72472726fe0b3fa70136046d62b94..c82f27fb4edd4c279609251f708810ad22437788 100644 (file)
@@ -179,8 +179,8 @@ InitializeConsolePipe (
       *Handle = Buffer[0];\r
       Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
       ASSERT_EFI_ERROR (Status);\r
+      FreePool (Buffer);\r
     }\r
-    FreePool (Buffer);\r
   } else {\r
     Status = EFI_SUCCESS;\r
   }\r