Skip to content

Commit

Permalink
perf tools: Fix a memory leak on perf_read_values_destroy
Browse files Browse the repository at this point in the history
After freeing each elements of the @values->value, we should free itself
too.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1323703017-6060-5-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Dec 20, 2011
1 parent d74c896 commit 0161d82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/util/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void perf_read_values_destroy(struct perf_read_values *values)

for (i = 0; i < values->threads; i++)
free(values->value[i]);
free(values->value);
free(values->pid);
free(values->tid);
free(values->counterrawid);
Expand Down

0 comments on commit 0161d82

Please sign in to comment.