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.6.0-rc4~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aa6a2a06d8bcad8585b9e29ec6865454e9df4e68;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 e4a8fd23c..9975a1146 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -483,9 +483,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);