lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Nov 2019 13:24:33 -0200
From:   Arnaldo Carvalho de Melo <acme@...hat.com>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Hewenliang <hewenliang4@...wei.com>, tstoyanov@...are.com,
        namhyung@...nel.org, linux-kernel@...r.kernel.org,
        linfeilong@...wei.com
Subject: Re: [PATCH v2] tools lib traceevent: Fix memory leakage in
 copy_filter_type

Em Mon, Nov 18, 2019 at 09:28:44AM -0500, Steven Rostedt escreveu:
> 
> Arnaldo,
> 
> Can you take this patch?

Sure, taking this as an Acked-by you
 
> Thanks!
> 
> -- Steve
> 
> 
> On Fri, 25 Oct 2019 04:23:12 -0400
> Hewenliang <hewenliang4@...wei.com> wrote:
> 
> > It is necessary to free the memory that we have allocated
> > when error occurs.
> > 
> > Fixes: ef3072cd1d5c ("tools lib traceevent: Get rid of die in add_filter_type()")
> > Signed-off-by: Hewenliang <hewenliang4@...wei.com>
> > ---
> >  tools/lib/traceevent/parse-filter.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
> > index 552592d153fb..fbaa790d10d8 100644
> > --- a/tools/lib/traceevent/parse-filter.c
> > +++ b/tools/lib/traceevent/parse-filter.c
> > @@ -1473,8 +1473,10 @@ static int copy_filter_type(struct tep_event_filter *filter,
> >  	if (strcmp(str, "TRUE") == 0 || strcmp(str, "FALSE") == 0) {
> >  		/* Add trivial event */
> >  		arg = allocate_arg();
> > -		if (arg == NULL)
> > +		if (arg == NULL) {
> > +			free(str);
> >  			return -1;
> > +		}
> >  
> >  		arg->type = TEP_FILTER_ARG_BOOLEAN;
> >  		if (strcmp(str, "TRUE") == 0)
> > @@ -1483,8 +1485,11 @@ static int copy_filter_type(struct tep_event_filter *filter,
> >  			arg->boolean.value = 0;
> >  
> >  		filter_type = add_filter_type(filter, event->id);
> > -		if (filter_type == NULL)
> > +		if (filter_type == NULL) {
> > +			free(str);
> > +			free(arg);
> >  			return -1;
> > +		}
> >  
> >  		filter_type->filter = arg;
> >  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ