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 6d311868d8502bb87dc3caa875d29f60a08a3e4b..4c842762e3f2d483e2f7f29a3fac640ce89602ea 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[])