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.31; helo=mga06.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 134F5225FA075 for ; Tue, 10 Apr 2018 00:55:13 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 00:55:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,431,1517904000"; d="scan'208";a="42120291" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga003.jf.intel.com with ESMTP; 10 Apr 2018 00:55:12 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Eric Dong , Liming Gao Date: Tue, 10 Apr 2018 15:54:47 +0800 Message-Id: <20180410075447.121560-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180410075447.121560-1-dandan.bi@intel.com> References: <20180410075447.121560-1-dandan.bi@intel.com> Subject: [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, 10 Apr 2018 07:55:14 -0000 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/Source/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 = mQuestionList; mQuestionList = pNode[0]; for (Index = 0; Index < 3; Index++) { if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] = NULL; } } 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] != NULL) { delete pNode[Index]; } if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr [Index]; + VarIdStr [Index] = NULL; } } } VOID @@ -3214,11 +3216,12 @@ CVfrQuestionDB::RegisterNewTimeQuestion ( pNode[2]->mNext = mQuestionList; mQuestionList = pNode[0]; for (Index = 0; Index < 3; Index++) { if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] = NULL; } } 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] != NULL) { delete pNode[Index]; } if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] = NULL; } } } VOID -- 2.14.3.windows.1