]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTool/VfrCompile: make delete[] match with new[]
[mirror_edk2.git] / BaseTools / Source / C / VfrCompile / VfrCompiler.cpp
index ff2a837dfc8fa8de1c41026bddea7d65c8fe99dd..84c0e59b76f2c47af519066d8cbb000e0d568966 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler main class and main function.\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -284,7 +284,7 @@ CVfrCompiler::AppendIncludePath (
   strcat (IncludePaths, " -I ");\r
   strcat (IncludePaths, PathStr);\r
   if (mOptions.IncludePaths != NULL) {\r
-    delete mOptions.IncludePaths;\r
+    delete[] mOptions.IncludePaths;\r
   }\r
   mOptions.IncludePaths = IncludePaths;\r
 }\r
@@ -313,7 +313,7 @@ CVfrCompiler::AppendCPreprocessorOptions (
   strcat (Opt, " ");\r
   strcat (Opt, Options);\r
   if (mOptions.CPreprocessorOptions != NULL) {\r
-    delete mOptions.CPreprocessorOptions;\r
+    delete[] mOptions.CPreprocessorOptions;\r
   }\r
   mOptions.CPreprocessorOptions = Opt;\r
 }\r
@@ -531,12 +531,12 @@ CVfrCompiler::~CVfrCompiler (
   }\r
 \r
   if (mOptions.IncludePaths != NULL) {\r
-    delete mOptions.IncludePaths;\r
+    delete[] mOptions.IncludePaths;\r
     mOptions.IncludePaths = NULL;\r
   }\r
 \r
   if (mOptions.CPreprocessorOptions != NULL) {\r
-    delete mOptions.CPreprocessorOptions;\r
+    delete[] mOptions.CPreprocessorOptions;\r
     mOptions.CPreprocessorOptions = NULL;\r
   }\r
 \r
@@ -965,11 +965,11 @@ main (
   }\r
 \r
   if (gCBuffer.Buffer != NULL) {\r
-    delete gCBuffer.Buffer;\r
+    delete[] gCBuffer.Buffer;\r
   }\r
   \r
   if (gRBuffer.Buffer != NULL) {\r
-    delete gRBuffer.Buffer;\r
+    delete[] gRBuffer.Buffer;\r
   }\r
 \r
   return GetUtilityStatus ();\r