perf env: Free memory nodes data
authorJiri Olsa <jolsa@kernel.org>
Fri, 9 Mar 2018 10:14:34 +0000 (11:14 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Mar 2018 16:52:09 +0000 (13:52 -0300)
Forgot to free env's memory nodes, adding needed code to perf_env__exit.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180309101442.9224-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/env.c

index 6d31186..4c84276 100644 (file)
@@ -32,6 +32,10 @@ void perf_env__exit(struct perf_env *env)
        for (i = 0; i < env->caches_cnt; i++)
                cpu_cache_level__free(&env->caches[i]);
        zfree(&env->caches);
+
+       for (i = 0; i < env->nr_memory_nodes; i++)
+               free(env->memory_nodes[i].set);
+       zfree(&env->memory_nodes);
 }
 
 int perf_env__set_cmdline(struct perf_env *env, int argc, const char *argv[])