IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer()

Free HandleBuffer for error path in EfiLocateProtocolBuffer().

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Star Zeng 2018-06-04 18:05:34 +08:00
parent fe507283af
commit 76022b02e8
1 changed files with 4 additions and 0 deletions

View File

@ -1650,6 +1650,10 @@ EfiLocateProtocolBuffer (
(VOID **)Buffer
);
if (EFI_ERROR (Status)) {
//
// Free the handle buffer
//
gBS->FreePool (HandleBuffer);
return EFI_OUT_OF_RESOURCES;
}
ZeroMem (*Buffer, NoHandles * sizeof (VOID *));