Re: [PATCH] perf subcmd: Fix missing check for return value of malloc() in add_cmdname()

From: Namhyung Kim
Date: Wed Jun 21 2023 - 13:25:03 EST


On Wed, Jun 14, 2023 at 9:21 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Wed, Jun 14, 2023 at 8:01 AM Chenyuan Mi <cymi20@xxxxxxxxxxxx> wrote:
> >
> > 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@xxxxxxxxxxxx>
>
> Acked-by: Ian Rogers <irogers@xxxxxxxxxx>

Applied to perf-tools-next, thanks!