From: Jérémie Galarneau Date: Fri, 4 Jul 2014 19:33:49 +0000 (-0400) Subject: Fix: check malloc return value X-Git-Tag: v2.6.0-rc1~157 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f696221981e71b00f032431cf10e72fcb6e59ad7;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 87935393e..f56adf482 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -117,6 +117,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");