linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH] trace-cmd: free kbuf on malloc err in tracecmd_read_page_record()
Date: Mon, 20 Jan 2020 21:18:29 -0500	[thread overview]
Message-ID: <20200120211829.4f9e94af@rorschach.local.home> (raw)
In-Reply-To: <20200115200515.207711-1-marcgonzalez@google.com>

On Wed, 15 Jan 2020 15:05:15 -0500
Marcelo Diop-Gonzalez <marcgonzalez@google.com> wrote:

> This fixes an unlikely but possible leak

Applied, thanks Marcelo!

-- Steve

> 
> Signed-off-by: Marcelo Diop-Gonzalez <marcgonzalez@google.com>
> ---
>  lib/trace-cmd/trace-input.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
> index ac30a60..68da3a7 100644
> --- a/lib/trace-cmd/trace-input.c
> +++ b/lib/trace-cmd/trace-input.c
> @@ -1746,7 +1746,7 @@ tracecmd_read_page_record(struct tep_handle *pevent, void *page, int size,
>  
>  	record = malloc(sizeof(*record));
>  	if (!record)
> -		return NULL;
> +		goto out_free;
>  	memset(record, 0, sizeof(*record));
>  
>  	record->ts = ts;


      reply	other threads:[~2020-01-21  2:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 20:05 [PATCH] trace-cmd: free kbuf on malloc err in tracecmd_read_page_record() Marcelo Diop-Gonzalez
2020-01-21  2:18 ` Steven Rostedt [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=20200120211829.4f9e94af@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=marcgonzalez@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).