X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=78bbbaaad37e25a6e94648236860fe11a60252db;hb=81663f073dbfb4b61c06a0ceb8ca33c4fc41b1c5;hp=2e473f519f3c52924eb7f3c40ac30b8ff8870ab0;hpb=dec2c8e12255d3533664cba9042f0d051c4207ac;p=lttng-tools.git diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 2e473f519..78bbbaaad 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -241,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."); } @@ -272,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; @@ -423,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;