Fix: Unhandled domain option condition in list_agent_events
[lttng-tools.git] / src / bin / lttng / commands / list.c
index 1eac93487a12604edb9095edb42e3ee53f08cf65..cc776dd427dcc5e30bce41d430f26c1a6ac77fcd 100644 (file)
@@ -408,8 +408,8 @@ static int list_agent_events(void)
 {
        int i, size, ret = CMD_SUCCESS;
        struct lttng_domain domain;
-       struct lttng_handle *handle;
-       struct lttng_event *event_list;
+       struct lttng_handle *handle = NULL;
+       struct lttng_event *event_list = NULL;
        pid_t cur_pid = 0;
        char *cmdline = NULL;
        const char *agent_domain_str;
@@ -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);
This page took 0.024965 seconds and 4 git commands to generate.