From 7ac4250e872424307c87a1565449a52f3e280953 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Tue, 10 Apr 2018 15:21:40 +0800 Subject: [PATCH] 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 Reviewed-by: Eric Dong --- 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 5cab7bbfa1..d795ef01bd 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -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; } } @@ -3057,7 +3058,8 @@ Err: } if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr [Index]; + VarIdStr [Index] = NULL; } } } @@ -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; } } @@ -3233,7 +3236,8 @@ Err: } if (VarIdStr[Index] != NULL) { - delete VarIdStr[Index]; + delete[] VarIdStr[Index]; + VarIdStr[Index] = NULL; } } }