X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Flist.c;h=cc776dd427dcc5e30bce41d430f26c1a6ac77fcd;hp=108f76065f907ad8b2dc9606b45b3d28dfdf2369;hb=26c610c93764a717a2e1292cf1a161262b7c6e3f;hpb=469b972be129ee907bb7ef4ee987cf040555c066 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);