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.5.3~17 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=5df0452695e2e6a4c3640eaeff10742bbbc34652 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 d4d40f077..b9dea18e1 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -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);