perf util: Fix potential SEGFAULT in put_tracepoints_path error path
authorLi Bin <huawei.libin@huawei.com>
Thu, 21 May 2020 13:32:18 +0000 (21:32 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 28 May 2020 13:03:27 +0000 (10:03 -0300)
commitfa99ce828291cbbf8782284665365bc2c48e9318
tree59dbc6298bbf1bbee60425364e86ba9a9e2378e9
parent07e9a6f538cbeecaf5c55b6f2991416f873cdcbd
perf util: Fix potential SEGFAULT in put_tracepoints_path error path

This patch fix potential segment fault triggered in
put_tracepoints_path() when the address of the local variable 'path' be
freed in error path of record_saved_cmdline.

Signed-off-by: Li Bin <huawei.libin@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hongbo Yao <yaohongbo@huawei.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Link: http://lore.kernel.org/lkml/20200521133218.30150-5-liwei391@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/trace-event-info.c