Cleanup: always use sysconf to get the page size
[lttng-tools.git] / src / bin / lttng / commands / destroy.c
index eed1fe5c5878fc15679009c64b18e0788adf0cf9..78bbbaaad37e25a6e94648236860fe11a60252db 100644 (file)
@@ -87,10 +87,13 @@ static int destroy_session(struct lttng_session *session)
                         * availability.
                         */
                        if (ret) {
-                               _MSG("Destroying session %s", session->name);
-                               newline_needed = true;
-                               printed_destroy_msg = true;
-                               fflush(stdout);
+                               if (!printed_destroy_msg) {
+                                       _MSG("Destroying session %s",
+                                                       session->name);
+                                       newline_needed = true;
+                                       printed_destroy_msg = true;
+                                       fflush(stdout);
+                               }
 
                                usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US);
                                _MSG(".");
@@ -238,7 +241,7 @@ static int destroy_all_sessions(struct lttng_session *sessions, int count)
        int i;
        bool error_occurred = false;
 
-       assert(count >= 0);
+       LTTNG_ASSERT(count >= 0);
        if (count == 0) {
                MSG("No session found, nothing to do.");
        }
@@ -269,7 +272,7 @@ int cmd_destroy(int argc, const char **argv)
        char *session_name = NULL;
        const char *leftover = NULL;
 
-       struct lttng_session *sessions;
+       struct lttng_session *sessions = NULL;
        int count;
        int found;
 
@@ -420,6 +423,8 @@ end:
                free(session_name);
        }
 
+       free(sessions);
+
        /* Overwrite ret if an error occurred during destroy_session/all */
        ret = command_ret ? command_ret : ret;
 
This page took 0.023511 seconds and 4 git commands to generate.