mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str()
slist needs to be freed in both error path and normal path in
thread_map__new_by_tid_str().
Fixes: b52956c961
("perf tools: Allow multiple threads or processes in record, stat, top")
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240206083228.172607-6-yangjihong1@huawei.com
This commit is contained in:
parent
bd2cdf26b9
commit
1eb3d924e3
1 changed files with 1 additions and 1 deletions
|
@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str)
|
|||
threads->nr = ntasks;
|
||||
}
|
||||
out:
|
||||
strlist__delete(slist);
|
||||
if (threads)
|
||||
refcount_set(&threads->refcnt, 1);
|
||||
return threads;
|
||||
|
||||
out_free_threads:
|
||||
zfree(&threads);
|
||||
strlist__delete(slist);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue