From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org 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 5C6A421F2E17B for ; Tue, 17 Apr 2018 01:17:26 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 01:17:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,462,1517904000"; d="scan'208";a="51382810" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 17 Apr 2018 01:17:25 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Apr 2018 01:17:25 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 17 Apr 2018 01:17:25 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.40]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.109]) with mapi id 14.03.0319.002; Tue, 17 Apr 2018 16:17:23 +0800 From: "Dong, Eric" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [patch 2/2] BaseTool/VfrCompile: make delete[] match with new[] Thread-Index: AQHT0KFIEoHYTS7ZJUC4VXK8lU45w6QEp7wQ Date: Tue, 17 Apr 2018 08:17:22 +0000 Message-ID: References: <20180410075447.121560-1-dandan.bi@intel.com> <20180410075447.121560-2-dandan.bi@intel.com> In-Reply-To: <20180410075447.121560-2-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 2/2] BaseTool/VfrCompile: make delete[] match with new[] 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: Tue, 17 Apr 2018 08:17:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong -----Original Message----- From: Bi, Dandan=20 Sent: Tuesday, April 10, 2018 3:55 PM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Gao, Liming Subject: [patch 2/2] BaseTool/VfrCompile: make delete[] match with new[] Cc: Eric Dong Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/So= urce/C/VfrCompile/VfrUtilityLib.cpp index 5cab7bbfa1a..d795ef01bda 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -3038,11 +3038,12 @@ CVfrQuestionDB::RegisterNewDateQuestion ( pNode[2]->mNext =3D mQuestionList; mQuestionList =3D pNode[0]; =20 for (Index =3D 0; Index < 3; Index++) { if (VarIdStr[Index] !=3D NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] =3D NULL; } } =20 gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_= QUESTION_ID)); gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_= QUESTION_ID)); @@ -3055,11 +3056,12 @@ Err: if (pNode[Index] !=3D NULL) { delete pNode[Index]; } =20 if (VarIdStr[Index] !=3D NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr [Index]; + VarIdStr [Index] =3D NULL; } } } =20 VOID @@ -3214,11 +3216,12 @@ CVfrQuestionDB::RegisterNewTimeQuestion ( pNode[2]->mNext =3D mQuestionList; mQuestionList =3D pNode[0]; =20 for (Index =3D 0; Index < 3; Index++) { if (VarIdStr[Index] !=3D NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] =3D NULL; } } =20 gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_= QUESTION_ID)); gCFormPkg.DoPendingAssign (VarIdStr[1], (VOID *)&QuestionId, sizeof(EFI_= QUESTION_ID)); @@ -3231,11 +3234,12 @@ Err: if (pNode[Index] !=3D NULL) { delete pNode[Index]; } =20 if (VarIdStr[Index] !=3D NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] =3D NULL; } } } =20 VOID -- 2.14.3.windows.1