From 3a2b37f0d4d489322499110b44b6f74bbe7329d6 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 27 Mar 2015 17:27:24 +0000 Subject: [PATCH] ArmPlatformPkg: fix two instances of FreePool () on NULL value 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 Reviewed-by: Ronald Cron git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17078 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/Bds.c | 2 +- ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c index 971ab07524..6a12717a1c 100644 --- a/ArmPlatformPkg/Bds/Bds.c +++ b/ArmPlatformPkg/Bds/Bds.c @@ -155,8 +155,8 @@ InitializeConsolePipe ( *Handle = Buffer[0]; Status = gBS->HandleProtocol (*Handle, Protocol, Interface); ASSERT_EFI_ERROR(Status); + FreePool (Buffer); } - FreePool (Buffer); } else { Status = EFI_SUCCESS; } diff --git a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c index c07fc0f607..c82f27fb4e 100644 --- a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c +++ b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c @@ -179,8 +179,8 @@ InitializeConsolePipe ( *Handle = Buffer[0]; Status = gBS->HandleProtocol (*Handle, Protocol, Interface); ASSERT_EFI_ERROR (Status); + FreePool (Buffer); } - FreePool (Buffer); } else { Status = EFI_SUCCESS; } -- 2.39.2