Skip to content

Commit 1eb3d92

Browse files
Yang Jihongnamhyung
authored andcommitted
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: b52956c ("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]
1 parent bd2cdf2 commit 1eb3d92

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/util/thread_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str)
280280
threads->nr = ntasks;
281281
}
282282
out:
283+
strlist__delete(slist);
283284
if (threads)
284285
refcount_set(&threads->refcnt, 1);
285286
return threads;
286287

287288
out_free_threads:
288289
zfree(&threads);
289-
strlist__delete(slist);
290290
goto out;
291291
}
292292

0 commit comments

Comments
 (0)