Fix: Unhandled domain option condition in list_agent_events
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Jul 2015 22:01:02 +0000 (18:01 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Jul 2015 22:01:02 +0000 (18:01 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/list.c

index 108f76065f907ad8b2dc9606b45b3d28dfdf2369..cc776dd427dcc5e30bce41d430f26c1a6ac77fcd 100644 (file)
@@ -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);
This page took 0.035765 seconds and 4 git commands to generate.