diff options
author | Star Zeng <star.zeng@intel.com> | 2018-04-13 14:29:49 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-07-09 13:34:23 +0800 |
commit | eb314ac46afbe569eb96ab11534f51cdc988f4e5 (patch) | |
tree | eba909cd84159f0baca6bb8db78a5669703f10c9 /MdePkg/Library/UefiLib/UefiLib.c | |
parent | 6a424a8a469990480b09d4697d25713ce58f810d (diff) | |
download | edk2-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.c | 4 |
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 *));
|