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>
Mon, 3 Aug 2015 16:07:27 +0000 (12:07 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/list.c

index 31f7bd97479cf7cbf559bbc961c841c9f0605897..3d0ce03048eb4152b2938abca31498a6c3ecc68a 100644 (file)
@@ -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);
This page took 0.028486 seconds and 4 git commands to generate.