Fix: check malloc return value
authorJérémie Galarneau <jeremie.galarneau@gmail.com>
Fri, 4 Jul 2014 19:33:49 +0000 (15:33 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 10 Jul 2014 14:39:11 +0000 (10:39 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/list.c

index 87935393edabbe076628d11a8a1f78c818225309..f56adf4821db71ca4d8d4f77bc7adabd36444302 100644 (file)
@@ -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");
This page took 0.027269 seconds and 5 git commands to generate.