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 <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
This commit is contained in:
Ard Biesheuvel 2015-03-27 17:27:24 +00:00 committed by lersek
parent 55f5af1871
commit 3a2b37f0d4
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}