diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-01-24 20:44:44 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-30 08:37:04 -0500 |
commit | 43f8e76e6b96eb1327cff62ac1cc733a51f31068 (patch) | |
tree | adbfe9a7f3972d4cd905e55aa3e1004e72179636 /tools/perf/builtin-stat.c | |
parent | 13370a9b5bb88f7aa90e5be68972d95096b20a6d (diff) |
perf evsel: Fix memory leaks on evsel->counts
The ->counts field was never freed in the current code. Add
perf_evsel__free_counts() function to free it properly.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1359078284-32080-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 493043abd164..0368a1036ad6 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -1372,6 +1372,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1372 | out_free_fd: | 1372 | out_free_fd: |
1373 | list_for_each_entry(pos, &evsel_list->entries, node) { | 1373 | list_for_each_entry(pos, &evsel_list->entries, node) { |
1374 | perf_evsel__free_stat_priv(pos); | 1374 | perf_evsel__free_stat_priv(pos); |
1375 | perf_evsel__free_counts(pos); | ||
1375 | perf_evsel__free_prev_raw_counts(pos); | 1376 | perf_evsel__free_prev_raw_counts(pos); |
1376 | } | 1377 | } |
1377 | perf_evlist__delete_maps(evsel_list); | 1378 | perf_evlist__delete_maps(evsel_list); |