public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue
Date: Fri, 23 Mar 2018 06:56:41 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1EC035@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1519710827-11228-2-git-send-email-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Tuesday, February 27, 2018 1:54 PM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric <eric.dong@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [patch 2/2] 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>
> ---
>  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



  reply	other threads:[~2018-03-23  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  5:53 [patch 1/2] BaseTool/VfrCompile: make delete[] match with new[] Dandan Bi
2018-02-27  5:53 ` [patch 2/2] BaseTool/VfrCompile: Fix potential memory leak issue Dandan Bi
2018-03-23  6:56   ` Gao, Liming [this message]
2018-03-23  6:56 ` [patch 1/2] BaseTool/VfrCompile: make delete[] match with new[] Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E1EC035@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox