summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/machine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 5484fa4385fc..93c8b6fbc799 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -370,8 +370,10 @@ static struct thread *__machine__findnew_thread(struct machine *machine,
* within thread__init_map_groups to find the thread
* leader and that would screwed the rb tree.
*/
- if (thread__init_map_groups(th, machine))
+ if (thread__init_map_groups(th, machine)) {
+ thread__delete(th);
return NULL;
+ }
}
return th;