Fix: lttng view.c missing strdup OOM check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Nov 2014 17:32:28 +0000 (12:32 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Nov 2014 20:26:49 +0000 (15:26 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/view.c

index c2a3c217076b029eca78145d1d7fe84ebed3a0d1..c0ff9d06046936650a3e921ecd92a5c2070d1632 100644 (file)
@@ -159,6 +159,9 @@ static char **alloc_argv_from_user_opts(char *opts, const char *trace_path)
        token = strtok(opts, " ");
        while (token != NULL) {
                argv[i] = strdup(token);
+               if (argv[i] == NULL) {
+                       goto error;
+               }
                token = strtok(NULL, " ");
                i++;
        }
This page took 0.026176 seconds and 4 git commands to generate.