summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/UefiLib/UefiLib.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-04-13 14:29:49 +0800
committerStar Zeng <star.zeng@intel.com>2018-07-09 13:34:23 +0800
commiteb314ac46afbe569eb96ab11534f51cdc988f4e5 (patch)
treeeba909cd84159f0baca6bb8db78a5669703f10c9 /MdePkg/Library/UefiLib/UefiLib.c
parent6a424a8a469990480b09d4697d25713ce58f810d (diff)
downloadedk2-eb314ac46afbe569eb96ab11534f51cdc988f4e5.tar.gz
edk2-eb314ac46afbe569eb96ab11534f51cdc988f4e5.tar.bz2
edk2-eb314ac46afbe569eb96ab11534f51cdc988f4e5.zip
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> (cherry picked from commit fe507283afe245dae5ffdc0f926d9e2abb355250)
Diffstat (limited to 'MdePkg/Library/UefiLib/UefiLib.c')
-rw-r--r--MdePkg/Library/UefiLib/UefiLib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c
index f1a3f1c7af..23f868d83c 100644
--- a/MdePkg/Library/UefiLib/UefiLib.c
+++ b/MdePkg/Library/UefiLib/UefiLib.c
@@ -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 *));