BaseTool/VfrCompile: Fix potential memory leak issue
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=771 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: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -3504,6 +3504,10 @@ CVfrStringDB::SetStringFileName(IN CHAR8 *StringFileName)
|
||||
return;
|
||||
}
|
||||
|
||||
if (mStringFileName != NULL) {
|
||||
delete[] mStringFileName;
|
||||
}
|
||||
|
||||
FileLen = strlen (StringFileName) + 1;
|
||||
mStringFileName = new CHAR8[FileLen];
|
||||
if (mStringFileName == NULL) {
|
||||
|
Reference in New Issue
Block a user