summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/header.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-12-27 16:55:14 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-27 17:08:19 -0300
commit74cf249d5cf7de84c88cca69a2f13b13d500ff94 (patch)
treefc61aabd22d981e95fe6ffe9a839e07bbb1f95a0 /tools/perf/util/header.c
parent046625231a0397f1776eb353a4ec9ff142cd2f6b (diff)
downloadlinux-stable-74cf249d5cf7de84c88cca69a2f13b13d500ff94.tar.gz
linux-stable-74cf249d5cf7de84c88cca69a2f13b13d500ff94.tar.bz2
linux-stable-74cf249d5cf7de84c88cca69a2f13b13d500ff94.zip
perf tools: Use zfree to help detect use after free bugs
Several areas already used this technique, so do some audit to consistently use it elsewhere. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-9sbere0kkplwe45ak6rk4a1f@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r--tools/perf/util/header.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 20f3a9c97bd8..a4a60b7887ee 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -800,10 +800,10 @@ static void free_cpu_topo(struct cpu_topo *tp)
return;
for (i = 0 ; i < tp->core_sib; i++)
- free(tp->core_siblings[i]);
+ zfree(&tp->core_siblings[i]);
for (i = 0 ; i < tp->thread_sib; i++)
- free(tp->thread_siblings[i]);
+ zfree(&tp->thread_siblings[i]);
free(tp);
}
@@ -1232,8 +1232,8 @@ static void free_event_desc(struct perf_evsel *events)
return;
for (evsel = events; evsel->attr.size; evsel++) {
- free(evsel->name);
- free(evsel->id);
+ zfree(&evsel->name);
+ zfree(&evsel->id);
}
free(events);
@@ -2105,7 +2105,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
ret = 0;
out_free:
for (i = 0; i < nr_groups; i++)
- free(desc[i].name);
+ zfree(&desc[i].name);
free(desc);
return ret;