From: Star Zeng Date: Mon, 4 Jun 2018 10:05:34 +0000 (+0800) Subject: IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer() X-Git-Tag: edk2-stable201903~1643 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=76022b02e867c7372c07d575a1733b8a84c6615a;ds=sidebyside IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer() Free HandleBuffer for error path in EfiLocateProtocolBuffer(). Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Michael D Kinney --- diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLib.c index 1d71f471b8..3eeb12110a 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 *));