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:26:58 +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/lttng.c

index d4d40f07722ef8aad0097164af92456454418f90..b9dea18e1952a7c735d529fb8e9da8b9c3f61fd0 100644 (file)
@@ -453,9 +453,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.026157 seconds and 4 git commands to generate.