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>
Wed, 26 Nov 2014 20:56:46 +0000 (15:56 -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 7658afc164668cbb74c1782ff290b169817ffd46..34ccd59c517a6a737f8953cc717f4de28e8f9f60 100644 (file)
@@ -484,9 +484,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.025464 seconds and 4 git commands to generate.