diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-09-27 13:40:58 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-11-08 16:37:17 +0800 |
commit | fd5425230ed22872126b52f22a7294e352ca3349 (patch) | |
tree | 2a4820e880131f8d83c68deddc064cbfc896e1b1 /BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | |
parent | a6ac965bca117ef33b38a96c36643b36757b7698 (diff) | |
download | edk2-platforms-fd5425230ed22872126b52f22a7294e352ca3349.tar.xz |
BaseTools/VfrCompile: Avoid freeing memory with mismatched functions
Memory allocated by operator new[] should be freed using delete[] to avoid
possible memory leak.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrCompiler.cpp')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp index 16453439ec..1bca37244d 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp @@ -677,7 +677,7 @@ CVfrCompiler::PreProcess ( goto Fail;
}
- delete PreProcessCmd;
+ delete[] PreProcessCmd;
Out:
SET_RUN_STATUS (STATUS_PREPROCESSED);
@@ -687,7 +687,7 @@ Fail: if (!IS_RUN_STATUS(STATUS_DEAD)) {
SET_RUN_STATUS (STATUS_FAILED);
}
- delete PreProcessCmd;
+ delete[] PreProcessCmd;
}
extern UINT8 VfrParserStart (IN FILE *, IN INPUT_INFO_TO_SYNTAX *);
|