linux/tools
Zheng Zengkai b4281b2f75 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-30 11:26:05 +01:00
..
accounting
arch
bpf
build
cgroup
firewire
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:14:39 +02:00
hv
iio
include bpf: Fix comment for helper bpf_current_task_under_cgroup() 2020-11-05 11:08:34 +01:00
kvm/kvm_stat
laptop
leds
lib
memory-model
nfsd
objtool x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes 2020-12-11 13:25:02 +01:00
pci
pcmcia
perf perf record: Fix memory leak when using '--user-regs=?' to list registers 2020-12-30 11:26:05 +01:00
power tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility 2020-10-01 13:14:31 +02:00
scripts
spi
testing selftests/bpf/test_offload.py: Reset ethtool features after failed setting 2020-12-30 11:25:45 +01:00
thermal/tmon
time
usb
virtio
vm
wmi
Makefile