X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Flibctfcopytrace%2Fctfcopytrace.c;h=b50783ccae81f4cff05871f637d84530de388320;hb=2ca6de5cb597b4c40251f1f744cb47b909d31c79;hp=5c78d6f8c968b89f7ed665e8d77eef620200c48e;hpb=7d532c324a0e9eb237aedb52be9aa54d3219785a;p=babeltrace.git diff --git a/plugins/libctfcopytrace/ctfcopytrace.c b/plugins/libctfcopytrace/ctfcopytrace.c index 5c78d6f8..b50783cc 100644 --- a/plugins/libctfcopytrace/ctfcopytrace.c +++ b/plugins/libctfcopytrace/ctfcopytrace.c @@ -398,20 +398,16 @@ struct bt_ctf_stream_class *ctf_copy_stream_class(FILE *err, } type = bt_ctf_stream_class_get_packet_context_type(stream_class); - if (!type) { - fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, - __LINE__); - goto error; - } - - ret_int = bt_ctf_stream_class_set_packet_context_type( - writer_stream_class, type); - if (ret_int < 0) { - fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__, - __LINE__); - goto error; + if (type) { + ret_int = bt_ctf_stream_class_set_packet_context_type( + writer_stream_class, type); + if (ret_int < 0) { + fprintf(err, "[error] %s in %s:%d\n", __func__, + __FILE__, __LINE__); + goto error; + } + BT_PUT(type); } - BT_PUT(type); type = bt_ctf_stream_class_get_event_header_type(stream_class); if (!type) {