int get_session_stats_str(const char *session_name, char **out_str)
{
int count, nb_domains, domain_idx, channel_idx, session_idx, ret;
- struct lttng_domain *domains;
- struct lttng_channel *channels;
+ struct lttng_domain *domains = NULL;
+ struct lttng_channel *channels = NULL;
uint64_t discarded_events_total = 0, lost_packets_total = 0;
struct lttng_session *sessions = NULL;
const struct lttng_session *selected_session = NULL;
goto end;
}
+ free(channels);
+ channels = NULL;
count = lttng_list_channels(handle, &channels);
for (channel_idx = 0; channel_idx < count; channel_idx++) {
uint64_t discarded_events = 0, lost_packets = 0;
}
end:
free(sessions);
+ free(channels);
+ free(domains);
return ret;
}