diff options
author | Chenyuan Mi <cymi20@fudan.edu.cn> | 2023-06-14 08:01:18 -0700 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2023-06-20 16:55:35 -0700 |
commit | 53fc25b7f557089aff101235152ae4bff15c428a (patch) | |
tree | 864cba4e08d999ce2895599c9238ef0bdf05f9db /tools/perf/util | |
parent | 240de691dd6684d15f63613aa7fbc64e6098d6c9 (diff) | |
download | linux-stable-53fc25b7f557089aff101235152ae4bff15c428a.tar.gz linux-stable-53fc25b7f557089aff101235152ae4bff15c428a.tar.bz2 linux-stable-53fc25b7f557089aff101235152ae4bff15c428a.zip |
perf subcmd: Fix missing check for return value of malloc() in add_cmdname()
The malloc() function may return NULL when it fails,
which may cause null pointer deference in add_cmdname(),
add Null check for return value of malloc().
Found by our static analysis tool.
Signed-off-by: Chenyuan Mi <cymi20@fudan.edu.cn>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20230614150118.115208-1-cymi20@fudan.edu.cn
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util')
0 files changed, 0 insertions, 0 deletions