Free HandleBuffer for error path in EfiLocateProtocolBuffer().

Cc: Michael D Kinney <michael.d.kin...@intel.com>
Cc: Liming Gao <liming....@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.z...@intel.com>
---
 IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c 
b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
index 1d71f471b84f..3eeb12110a90 100644
--- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
+++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c
@@ -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 *));
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to