From 8db2a1398a36e70aed62a5f9c3d7142efb159d31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 24 Jul 2015 18:01:02 -0400 Subject: [PATCH] Fix: Unhandled domain option condition in list_agent_events MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/list.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 31f7bd974..3d0ce0304 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -418,7 +418,7 @@ static int list_agent_events(void) { int i, size, ret = CMD_SUCCESS; struct lttng_domain domain; - struct lttng_handle *handle; + struct lttng_handle *handle = NULL; struct lttng_event *event_list = NULL; pid_t cur_pid = 0; char *cmdline = NULL; @@ -429,6 +429,10 @@ static int list_agent_events(void) domain.type = LTTNG_DOMAIN_JUL; } else if (opt_log4j) { domain.type = LTTNG_DOMAIN_LOG4J; + } else { + ERR("Invalid agent domain selected."); + ret = CMD_ERROR; + goto error; } agent_domain_str = get_domain_str(domain.type); -- 2.34.1