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>
This commit is contained in:
@ -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 *);
|
||||
|
Reference in New Issue
Block a user