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=liming.gao@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 56BEB223E0BA9 for ; Thu, 22 Mar 2018 23:50:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 23:56:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,348,1517904000"; d="scan'208";a="36146829" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 22 Mar 2018 23:56:44 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Mar 2018 23:56:44 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.108]) with mapi id 14.03.0319.002; Fri, 23 Mar 2018 14:56:42 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Dong, Eric" Thread-Topic: [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue Thread-Index: AQHTr49qd4h/4jb8Gk+FCpkXUu7HrKPdiQ/Q Date: Fri, 23 Mar 2018 06:56:41 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1EC035@SHSMSX104.ccr.corp.intel.com> References: <1519710827-11228-1-git-send-email-dandan.bi@intel.com> <1519710827-11228-2-git-send-email-dandan.bi@intel.com> In-Reply-To: <1519710827-11228-2-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2018 06:50:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, February 27, 2018 1:54 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric ; Gao, Liming > Subject: [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D771 >=20 > Cc: Eric Dong > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/= Source/C/VfrCompile/VfrUtilityLib.cpp > index 9bdc544..5cab7bb 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp > +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp > @@ -3502,10 +3502,14 @@ CVfrStringDB::SetStringFileName(IN CHAR8 *StringF= ileName) >=20 > if (StringFileName =3D=3D NULL) { > return; > } >=20 > + if (mStringFileName !=3D NULL) { > + delete[] mStringFileName; > + } > + > FileLen =3D strlen (StringFileName) + 1; > mStringFileName =3D new CHAR8[FileLen]; > if (mStringFileName =3D=3D NULL) { > return; > } > -- > 1.9.5.msysgit.1