Skip to content

Commit

Permalink
BaseTool/VfrCompile: make delete[] match with new[]
Browse files Browse the repository at this point in the history
Cc: Eric Dong <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
  • Loading branch information
dandanbi authored and lgao4 committed Apr 17, 2018
1 parent 2aa9a9f commit 7ac4250
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,8 @@ CVfrQuestionDB::RegisterNewDateQuestion (

for (Index = 0; Index < 3; Index++) {
if (VarIdStr[Index] != NULL) {
delete VarIdStr[Index];
delete[] VarIdStr[Index];
VarIdStr[Index] = NULL;
}
}

Expand All @@ -3057,7 +3058,8 @@ CVfrQuestionDB::RegisterNewDateQuestion (
}

if (VarIdStr[Index] != NULL) {
delete VarIdStr[Index];
delete[] VarIdStr [Index];
VarIdStr [Index] = NULL;
}
}
}
Expand Down Expand Up @@ -3216,7 +3218,8 @@ CVfrQuestionDB::RegisterNewTimeQuestion (

for (Index = 0; Index < 3; Index++) {
if (VarIdStr[Index] != NULL) {
delete VarIdStr[Index];
delete[] VarIdStr[Index];
VarIdStr[Index] = NULL;
}
}

Expand All @@ -3233,7 +3236,8 @@ CVfrQuestionDB::RegisterNewTimeQuestion (
}

if (VarIdStr[Index] != NULL) {
delete VarIdStr[Index];
delete[] VarIdStr[Index];
VarIdStr[Index] = NULL;
}
}
}
Expand Down

0 comments on commit 7ac4250

Please sign in to comment.