* 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(".");
int i;
bool error_occurred = false;
- assert(count >= 0);
+ LTTNG_ASSERT(count >= 0);
if (count == 0) {
MSG("No session found, nothing to do.");
}
char *session_name = NULL;
const char *leftover = NULL;
- struct lttng_session *sessions;
+ struct lttng_session *sessions = NULL;
int count;
int found;
free(session_name);
}
+ free(sessions);
+
/* Overwrite ret if an error occurred during destroy_session/all */
ret = command_ret ? command_ret : ret;