X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Flttng-live%2Flttng-live-plugin.c;h=01d946be8acd11f6a0d4752338185fe36a215844;hp=dfabb986922341d1ea72bc004d190113a221c774;hb=b5e7994d62027cadcb2fb1b1f43c191f269b5e3f;hpb=2600cf835eaf1fa6b468f80eb283e3d7df03f743 diff --git a/formats/lttng-live/lttng-live-plugin.c b/formats/lttng-live/lttng-live-plugin.c index dfabb986..01d946be 100644 --- a/formats/lttng-live/lttng-live-plugin.c +++ b/formats/lttng-live/lttng-live-plugin.c @@ -223,6 +223,17 @@ gboolean g_uint64p_equal(gconstpointer a, gconstpointer b) return TRUE; } +static void free_session_streams(struct lttng_live_session *lsession) +{ + struct lttng_live_viewer_stream *lvstream, *tmp; + + bt_list_for_each_entry_safe(lvstream, tmp, &lsession->stream_list, + stream_node) { + bt_list_del(&lvstream->stream_node); + g_free(lvstream); + } +} + static int lttng_live_open_trace_read(const char *path) { int ret = 0; @@ -231,6 +242,8 @@ static int lttng_live_open_trace_read(const char *path) ctx = g_new0(struct lttng_live_ctx, 1); ctx->session = g_new0(struct lttng_live_session, 1); + BT_INIT_LIST_HEAD(&ctx->session->stream_list); + /* We need a pointer to the context from the packet_seek function. */ ctx->session->ctx = ctx; @@ -271,8 +284,8 @@ static int lttng_live_open_trace_read(const char *path) end_free: g_hash_table_destroy(ctx->session->ctf_traces); + free_session_streams(ctx->session); g_free(ctx->session); - g_free(ctx->session->streams); g_free(ctx); if (lttng_live_should_quit()) {