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

index 6b926954da8c29a53f36f0eea7a1fbea79752d38..13f813254e043802b0ca97be7cb571491677460b 100644 (file)
@@ -446,9 +446,17 @@ static int parse_args(int argc, char **argv)
                        break;
                case OPT_SESSION_PATH:
                        opt_sessiond_path = strdup(optarg);
+                       if (!opt_sessiond_path) {
+                               ret = -1;
+                               goto error;
+                       }
                        break;
                case OPT_RELAYD_PATH:
                        opt_relayd_path = strdup(optarg);
+                       if (!opt_relayd_path) {
+                               ret = -1;
+                               goto error;
+                       }
                        break;
                case OPT_DUMP_OPTIONS:
                        list_options(stdout);
This page took 0.025795 seconds and 4 git commands to generate.