commit | 9f7b591e0bcc34acbb7da37ce66161d9f6ffa961 | [log] [tgz] |
---|---|---|
author | Zheng Zengkai <[email protected]> | Fri Jul 03 17:33:44 2020 +0800 |
committer | Greg Kroah-Hartman <[email protected]> | Tue Dec 29 13:45:01 2020 +0100 |
tree | a27b2a20b896a5876943b5e9283c66554ffc56f7 | |
parent | 36200e4ac59b3e9542669ed26abadc7c41190130 [diff] |
perf record: Fix memory leak when using '--user-regs=?' to list registers [ Upstream commit 2eb5dd418034ecea2f7031e3d33f2991a878b148 ] When using 'perf record's option '-I' or '--user-regs=' along with argument '?' to list available register names, memory of variable 'os' allocated by strdup() needs to be released before __parse_regs() returns, otherwise memory leak will occur. Fixes: bcc84ec65ad1 ("perf record: Add ability to name registers to record") Signed-off-by: Zheng Zengkai <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Li Bin <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>