MdePkg UefiLib: 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-04-13 14:29:49 +08:00
parent 31f70606c6
commit fe507283af
1 changed files with 4 additions and 0 deletions

View File

@ -1678,6 +1678,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 *));