perf tools: Fix a memory leak on perf_read_values_destroy
authorNamhyung Kim <namhyung@gmail.com>
Mon, 12 Dec 2011 15:16:53 +0000 (00:16 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Dec 2011 15:41:34 +0000 (13:41 -0200)
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>
tools/perf/util/values.c

index bdd33470b2356e2574c72719d4f40e620002b983..697c8b4e59cc0cc4b906a73e0207364d4960854e 100644 (file)
@@ -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);