lkml.org 
[lkml]   [2013]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 06/15] perf tools: fix parse_events_terms() freeing local variable on error path
On Fri, Jun 28, 2013 at 07:41:55AM -0600, David Ahern wrote:
> On 6/28/13 12:32 AM, Adrian Hunter wrote:
>
> >>Seems like you can just fix parse_events__free_terms to do the right thing
> >>and not call free(terms) -- ie., no need for a separate "only" function.
> >> From there only test_term() needs to do the free(terms) and since it mallocs
> >>the memory there it is nicely symmetrical.
> >
> >There are 2 more calls to parse_events__free_terms in util/parse-events.y
> >
>
> Right and both look like stack case uses. I don't see the need for
> __free_terms to free the list so no need for an _only version.

there's also another one in pmu_alias_terms function
which uses on stack list_head

jirka


\
 
 \ /
  Last update: 2013-06-28 16:21    [W:0.052 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site