]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
BaseTool/VfrCompile: make delete[] match with new[]
[mirror_edk2.git] / 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