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/ui | |
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/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 022d1731b801..a7045ea6d1d5 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1327,7 +1327,7 @@ static int switch_data_file(void) | |||
1327 | 1327 | ||
1328 | abs_path[nr_options] = strdup(path); | 1328 | abs_path[nr_options] = strdup(path); |
1329 | if (!abs_path[nr_options]) { | 1329 | if (!abs_path[nr_options]) { |
1330 | free(options[nr_options]); | 1330 | zfree(&options[nr_options]); |
1331 | ui__warning("Can't search all data files due to memory shortage.\n"); | 1331 | ui__warning("Can't search all data files due to memory shortage.\n"); |
1332 | fclose(file); | 1332 | fclose(file); |
1333 | break; | 1333 | break; |
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index c244cb524ef2..831fbb77d1ff 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -510,7 +510,7 @@ print_entries: | |||
510 | 510 | ||
511 | free(line); | 511 | free(line); |
512 | out: | 512 | out: |
513 | free(rem_sq_bracket); | 513 | zfree(&rem_sq_bracket); |
514 | 514 | ||
515 | return ret; | 515 | return ret; |
516 | } | 516 | } |