linux-stable/tools/perf
Zheng Zengkai 48bf1a9af8 perf record: Fix memory leak when using '--user-regs=?' to list registers
[ Upstream commit 2eb5dd4180 ]

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: bcc84ec65a ("perf record: Add ability to name registers to record")
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Li Bin <huawei.libin@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20200703093344.189450-1-zhengzengkai@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-29 13:47:03 +01:00
..
arch perf unwind: Fix libunwind build failure on i386 systems 2019-10-11 18:18:43 +02:00
bench perf bench mem: Always memset source before memcpy 2020-08-21 09:48:23 +02:00
Documentation perf record/stat: Explicitly call out event modifiers in the documentation 2020-09-09 19:03:06 +02:00
jvmti
pmu-events perf jevents: Fix period for Intel fixed counters 2019-11-06 12:43:04 +01:00
python
scripts
tests perf test: Fix test trace+probe_vfs_getname.sh on s390 2020-10-01 13:12:34 +02:00
trace perf trace beauty ioctl: Fix off-by-one error in cmd->string table 2019-10-05 12:47:56 +02:00
ui perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc 2020-03-11 18:02:54 +01:00
util perf record: Fix memory leak when using '--user-regs=?' to list registers 2020-12-29 13:47:03 +01:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix return type for histogram sorting comparision functions 2020-02-05 14:18:12 +00:00
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace: Fix failure to set cpumask when only one cpu is present 2019-08-29 08:26:41 +02:00
builtin-help.c perf help: Remove needless use of strncpy() 2019-07-03 13:15:57 +02:00
builtin-inject.c
builtin-kallsyms.c
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2019-11-10 11:25:13 +01:00
builtin-kvm.c
builtin-list.c
builtin-lock.c perf lock: Don't free "lock_seq_stat" if read_count isn't zero 2020-11-24 13:05:46 +01:00
builtin-mem.c
builtin-probe.c perf probe: Do not show the skipped events 2020-06-20 10:25:21 +02:00
builtin-record.c
builtin-report.c perf report: Fix NULL pointer dereference in hists__fprintf_nr_sample_events() 2020-06-25 15:41:58 +02:00
builtin-sched.c
builtin-script.c perf script: Fix brstackinsn for AUXTRACE 2020-01-04 13:59:52 +01:00
builtin-stat.c perf stat: Reset previous counts on repeat with interval 2019-10-11 18:18:47 +02:00
builtin-timechart.c
builtin-top.c perf top: Fix stdio interface input handling with glibc 2.28+ 2020-10-14 09:51:11 +02:00
builtin-trace.c
builtin-version.c
builtin.h
check-headers.sh
command-list.txt
CREDITS
design.txt
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-02 16:34:30 +02:00
Makefile.config perf tools: Support Python 3.8+ in Makefile 2020-04-24 08:00:44 +02:00
Makefile.perf
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c
perf.h perf tools: Increase MAX_NR_CPUS and MAX_CACHES 2019-07-31 07:28:30 +02:00