From: Jérémie Galarneau Date: Fri, 4 Jul 2014 19:33:49 +0000 (-0400) Subject: Fix: check malloc return value X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b20544380e8a0a99ac092e46192b437f62008c4a;p=lttng-tools.git Fix: check malloc return value Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index fee605fa8..3e6445d69 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -114,6 +114,10 @@ static char *get_cmdline_by_pid(pid_t pid) /* Caller must free() *cmdline */ cmdline = malloc(PATH_MAX); + if (!cmdline) { + perror("malloc cmdline"); + goto end; + } ret = fread(cmdline, 1, PATH_MAX, fp); if (ret < 0) { perror("fread proc list");