From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:33:34 +0000 (-0500) Subject: Fix: lttng lttng.c: check strdup OOM X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d7c5d39f7874e8acaa38a18405eb8ccdf67be5cc;p=lttng-tools.git Fix: lttng lttng.c: check strdup OOM Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 7658afc16..34ccd59c5 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -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);