diff options
author | Bi, Dandan <dandan.bi@intel.com> | 2018-02-27 13:53:47 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-03-23 14:59:01 +0800 |
commit | 65e0e10d23323b18f31bf9aa9eef3c2434f53780 (patch) | |
tree | 318862a64815f754cccb1f67e10b6549c5f59159 /BaseTools/Source | |
parent | f7e98581021b2dd29824f1de03c523b9c1ec617a (diff) | |
download | edk2-65e0e10d23323b18f31bf9aa9eef3c2434f53780.tar.gz edk2-65e0e10d23323b18f31bf9aa9eef3c2434f53780.tar.bz2 edk2-65e0e10d23323b18f31bf9aa9eef3c2434f53780.zip |
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>
Diffstat (limited to 'BaseTools/Source')
-rw-r--r-- | BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp index 9bdc54462c..5cab7bbfa1 100644 --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp @@ -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) {
|