Reviewed-by: Liming Gao <[email protected]>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Tuesday, February 27, 2018 1:54 PM
> To: [email protected]
> Cc: Dong, Eric <[email protected]>; Gao, Liming <[email protected]>
> Subject: [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=771
> 
> Cc: Eric Dong <[email protected]>
> Cc: Liming Gao <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <[email protected]>
> ---
>  BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 
> b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
> index 9bdc544..5cab7bb 100644
> --- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
> +++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
> @@ -3502,10 +3502,14 @@ CVfrStringDB::SetStringFileName(IN CHAR8 
> *StringFileName)
> 
>    if (StringFileName == NULL) {
>      return;
>    }
> 
> +  if (mStringFileName != NULL) {
> +    delete[] mStringFileName;
> +  }
> +
>    FileLen = strlen (StringFileName) + 1;
>    mStringFileName = new CHAR8[FileLen];
>    if (mStringFileName == NULL) {
>      return;
>    }
> --
> 1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to