summaryrefslogtreecommitdiff
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-07-30 18:31:28 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-30 18:31:28 -0300
commitd65a458b348cd458413b3cfec66e43ebd0367646 (patch)
tree984d730e5a81e4ae7c04b9f664d8a1cacdd0c6e6 /tools/perf/util/event.c
parent591765fdaf7ea1888157f342b67b0461f2e5ed9b (diff)
perf tools: Release session and symbol resources on exit
So that we reduce the noise when looking for leaks using tools such as valgrind. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 8151d23664c7..6b0db5577929 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -515,12 +515,13 @@ int event__process_mmap(event_t *self, struct perf_session *session)
if (machine == NULL)
goto out_problem;
thread = perf_session__findnew(session, self->mmap.pid);
+ if (thread == NULL)
+ goto out_problem;
map = map__new(&machine->user_dsos, self->mmap.start,
self->mmap.len, self->mmap.pgoff,
self->mmap.pid, self->mmap.filename,
MAP__FUNCTION);
-
- if (thread == NULL || map == NULL)
+ if (map == NULL)
goto out_problem;
thread__insert_map(thread, map);