Commit cd38d6b5 authored by zhaimingbing's avatar zhaimingbing Committed by Arnaldo Carvalho de Melo

perf script perl: Fail check on dynamic allocation

Return ENOMEM when dynamic allocation failed.
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Signed-off-by: default avatarzhaimingbing <zhaimingbing@cmss.chinamobile.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Li Dong <lidong@vivo.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20231120112356.8652-1-zhaimingbing@cmss.chinamobile.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b457c526
......@@ -490,6 +490,9 @@ static int perl_start_script(const char *script, int argc, const char **argv,
scripting_context->session = session;
command_line = malloc((argc + 2) * sizeof(const char *));
if (!command_line)
return -ENOMEM;
command_line[0] = "";
command_line[1] = script;
for (i = 2; i < argc + 2; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment