From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C962421BADAB3 for ; Mon, 4 Jun 2018 03:11:02 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 03:11:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,476,1520924400"; d="scan'208";a="64117523" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by orsmga002.jf.intel.com with ESMTP; 04 Jun 2018 03:11:01 -0700 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Michael D Kinney , Liming Gao Date: Mon, 4 Jun 2018 18:10:56 +0800 Message-Id: <1528107056-53060-3-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1528107056-53060-1-git-send-email-star.zeng@intel.com> References: <1528107056-53060-1-git-send-email-star.zeng@intel.com> Subject: [PATCH 2/2] IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2018 10:11:03 -0000 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 --- 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