diff options
author | Yang Jihong <[email protected]> | 2024-02-06 08:32:28 +0000 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2024-02-09 14:08:41 -0800 |
commit | 1eb3d924e3c0b8c27388b0583a989d757866efb6 (patch) | |
tree | eb79acbcfd1243e9fd501d720ae03aaa450ee26f | |
parent | bd2cdf26b9ea000339d54adc82e87fdbf22c21c3 (diff) |
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: b52956c961be3a04 ("perf tools: Allow multiple threads or processes in record, stat, top")
Reviewed-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Yang Jihong <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | tools/perf/util/thread_map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index e848579e61a8..ea3b431b9783 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -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; } |