From d7c5d39f7874e8acaa38a18405eb8ccdf67be5cc Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 12:33:34 -0500 Subject: [PATCH] Fix: lttng lttng.c: check strdup OOM MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng/lttng.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.34.1