Fix: handle loglevel range ALL in list command
[lttng-tools.git] / src / bin / lttng / commands / view.c
index 68ee4fa3ea1ec11343f07b40860bf3be03e85a2b..d339282e61e7513b3559643d646f5d847a20bf24 100644 (file)
@@ -278,7 +278,7 @@ error:
  */
 static int view_trace(void)
 {
-       int ret, count, i, found = 0;
+       int ret;
        char *session_name, *trace_path;
        struct lttng_session *sessions = NULL;
 
@@ -314,6 +314,8 @@ static int view_trace(void)
        DBG("Viewing trace for session %s", session_name);
 
        if (session_name) {
+               int i, count, found = 0;
+
                /* Getting all sessions */
                count = lttng_list_sessions(&sessions);
                if (count < 0) {
@@ -359,9 +361,7 @@ static int view_trace(void)
        }
 
 free_sessions:
-       if (sessions) {
-               free(sessions);
-       }
+       free(sessions);
 free_error:
        if (opt_session_name == NULL) {
                free(session_name);
This page took 0.022672 seconds and 4 git commands to generate.