mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Hewenliang <hewenliang4@huawei.com>,
	tstoyanov@vmware.com, linux-kernel@vger.kernel.org,
	linfeilong@huawei.com
Subject: Re: [PATCH] tools lib traceevent: Fix memory leakage in filter_event
Date: Fri, 20 Dec 2019 18:47:37 -0300	[thread overview]
Message-ID: <20191220214737.GB3582@redhat.com> (raw)
In-Reply-To: <20191219205631.2e12571c@rorschach.local.home>

Em Thu, Dec 19, 2019 at 08:56:31PM -0500, Steven Rostedt escreveu:
> On Mon, 9 Dec 2019 01:35:49 -0500
> Hewenliang <hewenliang4@huawei.com> wrote:
> 
> > It is necessary to call free_arg(arg) when add_filter_type returns NULL in
> > the function of filter_event.
> > 
> > Signed-off-by: Hewenliang <hewenliang4@huawei.com>
> 
> This looks fine.
> 
> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> Arnaldo, care to take this?

Sure, just landed in  acme/perf/urgent :)

- Arnaldo
 
> -- Steve
> 
> > ---
> >  tools/lib/traceevent/parse-filter.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
> > index f3cbf86e51ac..20eed719542e 100644
> > --- a/tools/lib/traceevent/parse-filter.c
> > +++ b/tools/lib/traceevent/parse-filter.c
> > @@ -1228,8 +1228,10 @@ filter_event(struct tep_event_filter *filter, struct tep_event *event,
> >  	}
> >  
> >  	filter_type = add_filter_type(filter, event->id);
> > -	if (filter_type == NULL)
> > +	if (filter_type == NULL) {
> > +		free_arg(arg);
> >  		return TEP_ERRNO__MEM_ALLOC_FAILED;
> > +	}
> >  
> >  	if (filter_type->filter)
> >  		free_arg(filter_type->filter);


  reply	other threads:[~2019-12-20 21:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09  6:35 Hewenliang
2019-12-20  1:56 ` Steven Rostedt
2019-12-20 21:47   ` Arnaldo Carvalho de Melo [this message]
2019-12-23 21:35 ` [tip: perf/urgent] " tip-bot2 for Hewenliang

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=20191220214737.GB3582@redhat.com \
    --to=acme@redhat.com \
    --cc=hewenliang4@huawei.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tstoyanov@vmware.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

Powered by JetHome