diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-27 14:55:14 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-27 15:08:19 -0500 |
commit | 74cf249d5cf7de84c88cca69a2f13b13d500ff94 (patch) | |
tree | fc61aabd22d981e95fe6ffe9a839e07bbb1f95a0 /tools/perf/util/hist.c | |
parent | 046625231a0397f1776eb353a4ec9ff142cd2f6b (diff) |
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/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 6cd4823a7a8b..4ed3e883240d 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -372,7 +372,7 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
372 | * This mem info was allocated from machine__resolve_mem | 372 | * This mem info was allocated from machine__resolve_mem |
373 | * and will not be used anymore. | 373 | * and will not be used anymore. |
374 | */ | 374 | */ |
375 | free(entry->mem_info); | 375 | zfree(&entry->mem_info); |
376 | 376 | ||
377 | /* If the map of an existing hist_entry has | 377 | /* If the map of an existing hist_entry has |
378 | * become out-of-date due to an exec() or | 378 | * become out-of-date due to an exec() or |
@@ -475,8 +475,8 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right) | |||
475 | 475 | ||
476 | void hist_entry__free(struct hist_entry *he) | 476 | void hist_entry__free(struct hist_entry *he) |
477 | { | 477 | { |
478 | free(he->branch_info); | 478 | zfree(&he->branch_info); |
479 | free(he->mem_info); | 479 | zfree(&he->mem_info); |
480 | free_srcline(he->srcline); | 480 | free_srcline(he->srcline); |
481 | free(he); | 481 | free(he); |
482 | } | 482 | } |