]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTool/VfrCompile: make delete[] match with new[]
authorDandan Bi <dandan.bi@intel.com>
Tue, 10 Apr 2018 07:21:40 +0000 (15:21 +0800)
committerLiming Gao <liming.gao@intel.com>
Tue, 17 Apr 2018 08:57:00 +0000 (16:57 +0800)
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: Eric Dong <eric.dong@intel.com>
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp

index 5cab7bbfa1afdeee0a56e7d8b45f319ff0d81267..d795ef01bda11778bac7233e45dcde7683426e44 100644 (file)
@@ -3040,7 +3040,8 @@ CVfrQuestionDB::RegisterNewDateQuestion (
 \r
   for (Index = 0; Index < 3; Index++) {\r
     if (VarIdStr[Index] != NULL) {\r
-      delete VarIdStr[Index];\r
+      delete[] VarIdStr[Index];\r
+      VarIdStr[Index] = NULL;\r
     }\r
   }\r
 \r
@@ -3057,7 +3058,8 @@ Err:
     }\r
 \r
     if (VarIdStr[Index] != NULL) {\r
-      delete VarIdStr[Index];\r
+      delete[] VarIdStr [Index];\r
+      VarIdStr [Index] = NULL;\r
     }\r
   }\r
 }\r
@@ -3216,7 +3218,8 @@ CVfrQuestionDB::RegisterNewTimeQuestion (
 \r
   for (Index = 0; Index < 3; Index++) {\r
     if (VarIdStr[Index] != NULL) {\r
-      delete VarIdStr[Index];\r
+      delete[] VarIdStr[Index];\r
+      VarIdStr[Index] = NULL;\r
     }\r
   }\r
 \r
@@ -3233,7 +3236,8 @@ Err:
     }\r
 \r
     if (VarIdStr[Index] != NULL) {\r
-      delete VarIdStr[Index];\r
+      delete[] VarIdStr[Index];\r
+      VarIdStr[Index] = NULL;\r
     }\r
   }\r
 }\r