From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 31284803AF for ; Thu, 9 Mar 2017 23:16:37 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2017 23:16:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,139,1486454400"; d="scan'208";a="66076669" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by orsmga004.jf.intel.com with ESMTP; 09 Mar 2017 23:16:36 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Jiewen Yao Date: Fri, 10 Mar 2017 15:16:28 +0800 Message-Id: <20170310071628.10044-3-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170310071628.10044-1-hao.a.wu@intel.com> References: <20170310071628.10044-1-hao.a.wu@intel.com> Subject: [PATCH v2 2/2] MdeModulePkg/CapsuleLib: Free the buffer returned by GetVariable2 API X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2017 07:16:37 -0000 Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c index fc0f8698a9..3fed8e06e4 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c @@ -342,6 +342,10 @@ InitCapsuleLastVariable ( 0, NULL ); + } else { + if (CapsuleResult != NULL) { + FreePool (CapsuleResult); + } } } -- 2.12.0.windows.1