summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBi, Dandan <dandan.bi@intel.com>2018-02-27 13:53:46 +0800
committerLiming Gao <liming.gao@intel.com>2018-03-23 14:58:54 +0800
commitf7e98581021b2dd29824f1de03c523b9c1ec617a (patch)
treefe07c9a4508a63f6616b6ab3a069b48e51fee395
parent0a4f2d48696f094cec73e28a4402775dc6262eef (diff)
downloadedk2-f7e98581021b2dd29824f1de03c523b9c1ec617a.zip
edk2-f7e98581021b2dd29824f1de03c523b9c1ec617a.tar.gz
edk2-f7e98581021b2dd29824f1de03c523b9c1ec617a.tar.bz2
BaseTool/VfrCompile: make delete[] match with new[]
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=764 Cc: Eric Dong <eric.dong@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.cpp14
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrError.cpp2
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp6
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrSyntax.g14
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp8
5 files changed, 22 insertions, 22 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
index ff2a837..84c0e59 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
@@ -2,7 +2,7 @@
VfrCompiler main class and main function.
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -284,7 +284,7 @@ CVfrCompiler::AppendIncludePath (
strcat (IncludePaths, " -I ");
strcat (IncludePaths, PathStr);
if (mOptions.IncludePaths != NULL) {
- delete mOptions.IncludePaths;
+ delete[] mOptions.IncludePaths;
}
mOptions.IncludePaths = IncludePaths;
}
@@ -313,7 +313,7 @@ CVfrCompiler::AppendCPreprocessorOptions (
strcat (Opt, " ");
strcat (Opt, Options);
if (mOptions.CPreprocessorOptions != NULL) {
- delete mOptions.CPreprocessorOptions;
+ delete[] mOptions.CPreprocessorOptions;
}
mOptions.CPreprocessorOptions = Opt;
}
@@ -531,12 +531,12 @@ CVfrCompiler::~CVfrCompiler (
}
if (mOptions.IncludePaths != NULL) {
- delete mOptions.IncludePaths;
+ delete[] mOptions.IncludePaths;
mOptions.IncludePaths = NULL;
}
if (mOptions.CPreprocessorOptions != NULL) {
- delete mOptions.CPreprocessorOptions;
+ delete[] mOptions.CPreprocessorOptions;
mOptions.CPreprocessorOptions = NULL;
}
@@ -965,11 +965,11 @@ main (
}
if (gCBuffer.Buffer != NULL) {
- delete gCBuffer.Buffer;
+ delete[] gCBuffer.Buffer;
}
if (gRBuffer.Buffer != NULL) {
- delete gRBuffer.Buffer;
+ delete[] gRBuffer.Buffer;
}
return GetUtilityStatus ();
diff --git a/BaseTools/Source/C/VfrCompile/VfrError.cpp b/BaseTools/Source/C/VfrCompile/VfrError.cpp
index 2366fac..14771a2 100644
--- a/BaseTools/Source/C/VfrCompile/VfrError.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrError.cpp
@@ -77,7 +77,7 @@ CVfrErrorHandle::~CVfrErrorHandle (
SVfrFileScopeRecord *pNode = NULL;
if (mInputFileName != NULL) {
- delete mInputFileName;
+ delete[] mInputFileName;
}
while (mScopeRecordListHead != NULL) {
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
index 090ee13..b40bcdf 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
@@ -144,7 +144,7 @@ CFormPkg::~CFormPkg ()
pBNode = mBufferNodeQueueHead;
mBufferNodeQueueHead = mBufferNodeQueueHead->mNext;
if (pBNode->mBufferStart != NULL) {
- delete pBNode->mBufferStart;
+ delete[] pBNode->mBufferStart;
delete pBNode;
}
}
@@ -1152,7 +1152,7 @@ CIfrRecordInfoDB::IfrRecordOutput (
SIfrRecord *pNode;
if (TBuffer.Buffer != NULL) {
- delete TBuffer.Buffer;
+ delete[] TBuffer.Buffer;
}
TBuffer.Size = 0;
@@ -2259,7 +2259,7 @@ CIfrObj::_EMIT_PENDING_OBJ (
// update bin buffer to package data buffer
//
if (mObjBinBuf != NULL) {
- delete mObjBinBuf;
+ delete[] mObjBinBuf;
mObjBinBuf = ObjBinBuf;
}
diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 4c7c6f2..d48072a 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -969,7 +969,7 @@ vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32 TypeSize,
break;
}
}
- if (TFName != NULL) { delete TFName; TFName = NULL; }
+ if (TFName != NULL) { delete[] TFName; TFName = NULL; }
>>
)*
)
@@ -1166,7 +1166,7 @@ vfrStatementVarStoreEfi :
VSEObj.SetSize ((UINT16) Size);
VSEObj.SetName (StoreName);
if (IsUEFI23EfiVarstore == FALSE && StoreName != NULL) {
- delete StoreName;
+ delete[] StoreName;
}
>>
";"
@@ -1324,7 +1324,7 @@ vfrQuestionBaseInfo[EFI_VARSTORE_INFO & Info, EFI_QUESTION_ID & QId, EFI_QUESION
>>
<<
if (VarIdStr != NULL) {
- delete VarIdStr;
+ delete[] VarIdStr;
}
_SAVE_CURRQEST_VARINFO (Info);
>>
@@ -1511,7 +1511,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
}
QuestVarIdStr = VarIdStr;
- if (VarStr != NULL) {delete VarStr;}
+ if (VarStr != NULL) {delete[] VarStr;}
>>
)
;
@@ -4667,7 +4667,7 @@ getExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
CIfrGet GObj(L->getLine());
_SAVE_OPHDR_COND (GObj, ($ExpOpCount == 0), L->getLine());
GObj.SetVarInfo (&Info);
- delete VarIdStr;
+ delete[] VarIdStr;
$ExpOpCount++;
}
>>
@@ -4841,7 +4841,7 @@ setExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
}
CIfrSet TSObj(L->getLine());
TSObj.SetVarInfo (&Info);
- delete VarIdStr;
+ delete[] VarIdStr;
$ExpOpCount++;
}
>>
@@ -5474,7 +5474,7 @@ EfiVfrParser::_STRCAT (
NewStr[0] = '\0';
if (*Dest != NULL) {
strcpy (NewStr, *Dest);
- delete *Dest;
+ delete[] *Dest;
}
strcat (NewStr, Src);
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
index c536498..9bdc544 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
@@ -2,7 +2,7 @@
Vfr common library functions.
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
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
@@ -360,7 +360,7 @@ CVfrBufferConfig::Write (
case 'i' : // set info
if (mItemListPos->mId != NULL) {
- delete mItemListPos->mId;
+ delete[] mItemListPos->mId;
}
mItemListPos->mId = NULL;
if (Id != NULL) {
@@ -1630,7 +1630,7 @@ SVfrVarStorageNode::~SVfrVarStorageNode (
}
if (mVarStoreType == EFI_VFR_VARSTORE_NAME) {
- delete mStorageInfo.mNameSpace.mNameTable;
+ delete[] mStorageInfo.mNameSpace.mNameTable;
}
}
@@ -3489,7 +3489,7 @@ CVfrStringDB::CVfrStringDB ()
CVfrStringDB::~CVfrStringDB ()
{
if (mStringFileName != NULL) {
- delete mStringFileName;
+ delete[] mStringFileName;
}
mStringFileName = NULL;
}