Commit b2e19a93 authored by Yasser Shalabi's avatar Yasser Shalabi Committed by Arnaldo Carvalho de Melo

perf evlist: Fix for double free in tools/perf stat

Fix for double free bug in tools/perf due to dangling thread_map pointer
in perf_evlist struct.

Code path excercised when perf stat -C switch is used but not set and is
followed by another switch.

Example:

  perf stat -C -e.
Signed-off-by: default avatarYasser Shalabi <yassershalabi@gmail.com>
Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1412437077-13109-1-git-send-email-yassershalabi@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ffe59788
...@@ -1003,6 +1003,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) ...@@ -1003,6 +1003,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
out_delete_threads: out_delete_threads:
thread_map__delete(evlist->threads); thread_map__delete(evlist->threads);
evlist->threads = NULL;
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment