aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/thread.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 7a32f447a8e7..b9c36ef42d2f 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -60,8 +60,10 @@ void thread__delete(struct thread *thread)
60{ 60{
61 struct comm *comm, *tmp; 61 struct comm *comm, *tmp;
62 62
63 map_groups__put(thread->mg); 63 if (thread->mg) {
64 thread->mg = NULL; 64 map_groups__put(thread->mg);
65 thread->mg = NULL;
66 }
65 list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) { 67 list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) {
66 list_del(&comm->list); 68 list_del(&comm->list);
67 comm__free(comm); 69 comm__free(comm);