From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:33:34 +0000 (-0500) Subject: Fix: lttng lttng.c: check strdup OOM X-Git-Tag: v2.4.3~12 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=108c9ffefd5170b5df566e3993c8196719e59c61;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 6b926954d..13f813254 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -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);