public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf inject: Fix missing free in copy_kcore_dir()
Date: Mon, 20 Jun 2022 17:57:11 -0300	[thread overview]
Message-ID: <YrDfJyV4Ycki9WdO@kernel.org> (raw)
In-Reply-To: <20220620103904.7960-1-adrian.hunter@intel.com>

Em Mon, Jun 20, 2022 at 01:39:04PM +0300, Adrian Hunter escreveu:
> Free string allocated by asprintf().
> 
> Fixes: d8fc08550929bb ("perf inject: Keep a copy of kcore_dir")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>

Thanks, applied.

- Arnaldo

> ---
>  tools/perf/builtin-inject.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
> index 42e2918fd1cc..fee9da14afc6 100644
> --- a/tools/perf/builtin-inject.c
> +++ b/tools/perf/builtin-inject.c
> @@ -891,7 +891,9 @@ static int copy_kcore_dir(struct perf_inject *inject)
>  	if (ret < 0)
>  		return ret;
>  	pr_debug("%s\n", cmd);
> -	return system(cmd);
> +	ret = system(cmd);
> +	free(cmd);
> +	return ret;
>  }
>  
>  static int output_fd(struct perf_inject *inject)
> -- 
> 2.25.1

-- 

- Arnaldo

      reply	other threads:[~2022-06-20 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 10:39 [PATCH] perf inject: Fix missing free in copy_kcore_dir() Adrian Hunter
2022-06-20 20:57 ` Arnaldo Carvalho de Melo [this message]

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-all 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=YrDfJyV4Ycki9WdO@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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