From 3d8d6ab0579eae00524249ad2a736cd14a5e0f88 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 108f76065..cc776dd42 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -408,7 +408,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; @@ -421,6 +421,10 @@ static int list_agent_events(void) domain.type = LTTNG_DOMAIN_LOG4J; } else if (opt_python) { domain.type = LTTNG_DOMAIN_PYTHON; + } else { + ERR("Invalid agent domain selected."); + ret = CMD_ERROR; + goto error; } agent_domain_str = get_domain_str(domain.type); -- 2.34.1