X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fir%2Ftrace.c;h=d911dfd69946029e8078814a4a94ac30f2ca1af1;hb=ae294457cab8841fdb945a70ee018637d4e62cc2;hp=158f2b8bbc2e6d13ea8555ecb95a8cff0011d306;hpb=6c827042b878570fc8418a7d3c99b2657c2541da;p=babeltrace.git diff --git a/formats/ctf/ir/trace.c b/formats/ctf/ir/trace.c index 158f2b8b..d911dfd6 100644 --- a/formats/ctf/ir/trace.c +++ b/formats/ctf/ir/trace.c @@ -156,11 +156,6 @@ struct bt_ctf_stream *bt_ctf_trace_create_stream(struct bt_ctf_trace *trace, goto error; } - stream = bt_ctf_stream_create(stream_class, trace); - if (!stream) { - goto error; - } - for (i = 0; i < trace->stream_classes->len; i++) { if (trace->stream_classes->pdata[i] == stream_class) { stream_class_found = 1; @@ -174,6 +169,11 @@ struct bt_ctf_stream *bt_ctf_trace_create_stream(struct bt_ctf_trace *trace, } } + stream = bt_ctf_stream_create(stream_class, trace); + if (!stream) { + goto error; + } + bt_ctf_stream_get(stream); g_ptr_array_add(trace->streams, stream);