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:52:32 +0000 (10:52 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/list.c

index 75288cd0a5867f0f005cc6c45913bfef71c69c71..0b1eff265b4635f4d1ffb0a568e5314d856256f8 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.026269 seconds and 4 git commands to generate.