From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 7206A21CAD99F for ; Sun, 16 Jul 2017 17:39:42 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2017 17:41:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,372,1496127600"; d="scan'208";a="1196109936" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 16 Jul 2017 17:41:34 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 16 Jul 2017 17:41:33 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 16 Jul 2017 17:41:33 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Mon, 17 Jul 2017 08:41:32 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH 2/2] MdePkg DxeHstiLib: Fix memory leak issue Thread-Index: AQHS/H7RI4j0Wq3/EkWtaKWYIAQqh6JXMdKA Date: Mon, 17 Jul 2017 00:41:30 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A97A3DF@shsmsx102.ccr.corp.intel.com> References: <1500022441-260844-1-git-send-email-star.zeng@intel.com> <1500022441-260844-3-git-send-email-star.zeng@intel.com> In-Reply-To: <1500022441-260844-3-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/2] MdePkg DxeHstiLib: Fix memory leak issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 00:39:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Friday, July 14, 2017 4:54 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH 2/2] MdePkg DxeHstiLib: Fix memory leak issue >=20 > The Hsti returned from InternalHstiFindAip() and temporally > allocated NewHsti need to be freed after used. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > MdePkg/Library/DxeHstiLib/HstiDxe.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/MdePkg/Library/DxeHstiLib/HstiDxe.c > b/MdePkg/Library/DxeHstiLib/HstiDxe.c > index c032a98647bf..58510766bb43 100644 > --- a/MdePkg/Library/DxeHstiLib/HstiDxe.c > +++ b/MdePkg/Library/DxeHstiLib/HstiDxe.c > @@ -1,6 +1,6 @@ > /** @file >=20 > - Copyright (c) 2015, Intel Corporation. All rights reserved.
> + Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be > found at > @@ -206,7 +206,7 @@ InternalHstiIsValidTable ( > } > } > if (Index =3D=3D > sizeof(Hsti->ImplementationID)/sizeof(Hsti->ImplementationID[0])) { > - DEBUG ((EFI_D_ERROR, "ImplementationID is no NUL CHAR\n")); > + DEBUG ((EFI_D_ERROR, "ImplementationID has no NUL CHAR\n")); > return FALSE; > } >=20 > @@ -416,6 +416,7 @@ InternalHstiRecordFeaturesVerified ( > Hsti, > HstiSize > ); > + FreePool (Hsti); > return Status; > } >=20 > @@ -545,6 +546,8 @@ InternalHstiRecordErrorString ( > NewHsti, > NewHstiSize > ); > + FreePool (Hsti); > + FreePool (NewHsti); > return Status; > } >=20 > -- > 2.7.0.windows.1