IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer()
authorStar Zeng <star.zeng@intel.com>
Mon, 4 Jun 2018 10:05:34 +0000 (18:05 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 5 Jun 2018 09:43:16 +0000 (17:43 +0800)
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>
IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c

index 1d71f47..3eeb121 100644 (file)
@@ -1650,6 +1650,10 @@ EfiLocateProtocolBuffer (
                   (VOID **)Buffer\r
                   );\r
   if (EFI_ERROR (Status)) {\r
+    //\r
+    // Free the handle buffer\r
+    //\r
+    gBS->FreePool (HandleBuffer);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
   ZeroMem (*Buffer, NoHandles * sizeof (VOID *));\r