Messages in this thread | | | Date | Wed, 8 Jan 2014 13:12:33 -0200 | From | Arnaldo Carvalho de Melo <> | Subject | Re: [PATCH 3/8] perf tools: free aliases[j] in pmu.c if name_only is true. |
| |
What for? Please be clear in the changelogs, it helps with review.
Now I'll have to follow the logic to figure this out, i.e. _why_ we should free aliases[j] if name_only is true? Is it safe?
- Arnaldo
Em Mon, Dec 30, 2013 at 10:26:38AM -0500, Dongsheng Yang escreveu: > Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> > --- > tools/perf/util/pmu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 331dc2c..169c480 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -752,6 +752,7 @@ unsigned int print_pmu_events(const char *event_glob, bool name_only) > for (j = 0; j < len; j++) { > if (name_only) { > printf("%s ", aliases[j]); > + zfree(&aliases[j]); > count++; > continue; > } > -- > 1.8.2.1
| |