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>
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
VfrCompiler main class and main function.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
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, " -I ");
|
||||||
strcat (IncludePaths, PathStr);
|
strcat (IncludePaths, PathStr);
|
||||||
if (mOptions.IncludePaths != NULL) {
|
if (mOptions.IncludePaths != NULL) {
|
||||||
delete mOptions.IncludePaths;
|
delete[] mOptions.IncludePaths;
|
||||||
}
|
}
|
||||||
mOptions.IncludePaths = IncludePaths;
|
mOptions.IncludePaths = IncludePaths;
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ CVfrCompiler::AppendCPreprocessorOptions (
|
|||||||
strcat (Opt, " ");
|
strcat (Opt, " ");
|
||||||
strcat (Opt, Options);
|
strcat (Opt, Options);
|
||||||
if (mOptions.CPreprocessorOptions != NULL) {
|
if (mOptions.CPreprocessorOptions != NULL) {
|
||||||
delete mOptions.CPreprocessorOptions;
|
delete[] mOptions.CPreprocessorOptions;
|
||||||
}
|
}
|
||||||
mOptions.CPreprocessorOptions = Opt;
|
mOptions.CPreprocessorOptions = Opt;
|
||||||
}
|
}
|
||||||
@ -531,12 +531,12 @@ CVfrCompiler::~CVfrCompiler (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mOptions.IncludePaths != NULL) {
|
if (mOptions.IncludePaths != NULL) {
|
||||||
delete mOptions.IncludePaths;
|
delete[] mOptions.IncludePaths;
|
||||||
mOptions.IncludePaths = NULL;
|
mOptions.IncludePaths = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mOptions.CPreprocessorOptions != NULL) {
|
if (mOptions.CPreprocessorOptions != NULL) {
|
||||||
delete mOptions.CPreprocessorOptions;
|
delete[] mOptions.CPreprocessorOptions;
|
||||||
mOptions.CPreprocessorOptions = NULL;
|
mOptions.CPreprocessorOptions = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,11 +965,11 @@ main (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gCBuffer.Buffer != NULL) {
|
if (gCBuffer.Buffer != NULL) {
|
||||||
delete gCBuffer.Buffer;
|
delete[] gCBuffer.Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gRBuffer.Buffer != NULL) {
|
if (gRBuffer.Buffer != NULL) {
|
||||||
delete gRBuffer.Buffer;
|
delete[] gRBuffer.Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetUtilityStatus ();
|
return GetUtilityStatus ();
|
||||||
|
@ -77,7 +77,7 @@ CVfrErrorHandle::~CVfrErrorHandle (
|
|||||||
SVfrFileScopeRecord *pNode = NULL;
|
SVfrFileScopeRecord *pNode = NULL;
|
||||||
|
|
||||||
if (mInputFileName != NULL) {
|
if (mInputFileName != NULL) {
|
||||||
delete mInputFileName;
|
delete[] mInputFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (mScopeRecordListHead != NULL) {
|
while (mScopeRecordListHead != NULL) {
|
||||||
|
@ -144,7 +144,7 @@ CFormPkg::~CFormPkg ()
|
|||||||
pBNode = mBufferNodeQueueHead;
|
pBNode = mBufferNodeQueueHead;
|
||||||
mBufferNodeQueueHead = mBufferNodeQueueHead->mNext;
|
mBufferNodeQueueHead = mBufferNodeQueueHead->mNext;
|
||||||
if (pBNode->mBufferStart != NULL) {
|
if (pBNode->mBufferStart != NULL) {
|
||||||
delete pBNode->mBufferStart;
|
delete[] pBNode->mBufferStart;
|
||||||
delete pBNode;
|
delete pBNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1152,7 +1152,7 @@ CIfrRecordInfoDB::IfrRecordOutput (
|
|||||||
SIfrRecord *pNode;
|
SIfrRecord *pNode;
|
||||||
|
|
||||||
if (TBuffer.Buffer != NULL) {
|
if (TBuffer.Buffer != NULL) {
|
||||||
delete TBuffer.Buffer;
|
delete[] TBuffer.Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
TBuffer.Size = 0;
|
TBuffer.Size = 0;
|
||||||
@ -2259,7 +2259,7 @@ CIfrObj::_EMIT_PENDING_OBJ (
|
|||||||
// update bin buffer to package data buffer
|
// update bin buffer to package data buffer
|
||||||
//
|
//
|
||||||
if (mObjBinBuf != NULL) {
|
if (mObjBinBuf != NULL) {
|
||||||
delete mObjBinBuf;
|
delete[] mObjBinBuf;
|
||||||
mObjBinBuf = ObjBinBuf;
|
mObjBinBuf = ObjBinBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -969,7 +969,7 @@ vfrExtensionData[UINT8 *DataBuff, UINT32 Size, CHAR8 *TypeName, UINT32 TypeSize,
|
|||||||
break;
|
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.SetSize ((UINT16) Size);
|
||||||
VSEObj.SetName (StoreName);
|
VSEObj.SetName (StoreName);
|
||||||
if (IsUEFI23EfiVarstore == FALSE && StoreName != NULL) {
|
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) {
|
if (VarIdStr != NULL) {
|
||||||
delete VarIdStr;
|
delete[] VarIdStr;
|
||||||
}
|
}
|
||||||
_SAVE_CURRQEST_VARINFO (Info);
|
_SAVE_CURRQEST_VARINFO (Info);
|
||||||
>>
|
>>
|
||||||
@ -1511,7 +1511,7 @@ vfrStorageVarId[EFI_VARSTORE_INFO & Info, CHAR8 *&QuestVarIdStr, BOOLEAN CheckFl
|
|||||||
}
|
}
|
||||||
|
|
||||||
QuestVarIdStr = VarIdStr;
|
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());
|
CIfrGet GObj(L->getLine());
|
||||||
_SAVE_OPHDR_COND (GObj, ($ExpOpCount == 0), L->getLine());
|
_SAVE_OPHDR_COND (GObj, ($ExpOpCount == 0), L->getLine());
|
||||||
GObj.SetVarInfo (&Info);
|
GObj.SetVarInfo (&Info);
|
||||||
delete VarIdStr;
|
delete[] VarIdStr;
|
||||||
$ExpOpCount++;
|
$ExpOpCount++;
|
||||||
}
|
}
|
||||||
>>
|
>>
|
||||||
@ -4841,7 +4841,7 @@ setExp[UINT32 & RootLevel, UINT32 & ExpOpCount] :
|
|||||||
}
|
}
|
||||||
CIfrSet TSObj(L->getLine());
|
CIfrSet TSObj(L->getLine());
|
||||||
TSObj.SetVarInfo (&Info);
|
TSObj.SetVarInfo (&Info);
|
||||||
delete VarIdStr;
|
delete[] VarIdStr;
|
||||||
$ExpOpCount++;
|
$ExpOpCount++;
|
||||||
}
|
}
|
||||||
>>
|
>>
|
||||||
@ -5474,7 +5474,7 @@ EfiVfrParser::_STRCAT (
|
|||||||
NewStr[0] = '\0';
|
NewStr[0] = '\0';
|
||||||
if (*Dest != NULL) {
|
if (*Dest != NULL) {
|
||||||
strcpy (NewStr, *Dest);
|
strcpy (NewStr, *Dest);
|
||||||
delete *Dest;
|
delete[] *Dest;
|
||||||
}
|
}
|
||||||
strcat (NewStr, Src);
|
strcat (NewStr, Src);
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Vfr common library functions.
|
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
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -360,7 +360,7 @@ CVfrBufferConfig::Write (
|
|||||||
|
|
||||||
case 'i' : // set info
|
case 'i' : // set info
|
||||||
if (mItemListPos->mId != NULL) {
|
if (mItemListPos->mId != NULL) {
|
||||||
delete mItemListPos->mId;
|
delete[] mItemListPos->mId;
|
||||||
}
|
}
|
||||||
mItemListPos->mId = NULL;
|
mItemListPos->mId = NULL;
|
||||||
if (Id != NULL) {
|
if (Id != NULL) {
|
||||||
@ -1630,7 +1630,7 @@ SVfrVarStorageNode::~SVfrVarStorageNode (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mVarStoreType == EFI_VFR_VARSTORE_NAME) {
|
if (mVarStoreType == EFI_VFR_VARSTORE_NAME) {
|
||||||
delete mStorageInfo.mNameSpace.mNameTable;
|
delete[] mStorageInfo.mNameSpace.mNameTable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3489,7 +3489,7 @@ CVfrStringDB::CVfrStringDB ()
|
|||||||
CVfrStringDB::~CVfrStringDB ()
|
CVfrStringDB::~CVfrStringDB ()
|
||||||
{
|
{
|
||||||
if (mStringFileName != NULL) {
|
if (mStringFileName != NULL) {
|
||||||
delete mStringFileName;
|
delete[] mStringFileName;
|
||||||
}
|
}
|
||||||
mStringFileName = NULL;
|
mStringFileName = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user