X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fir%2Fstream.c;h=56abfcea5f89fe1f78f47241428fcc20d3688361;hb=37f301682345ca58a078ba6bcd131fd0030fed0c;hp=04bd0dfeba207fff347d0b765cc06eab6cf270c7;hpb=b2b635e9948980a12a2dfd8137d756b119b7c297;p=babeltrace.git diff --git a/formats/ctf/ir/stream.c b/formats/ctf/ir/stream.c index 04bd0dfe..56abfcea 100644 --- a/formats/ctf/ir/stream.c +++ b/formats/ctf/ir/stream.c @@ -582,13 +582,13 @@ int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, bt_object_set_parent(event, stream); ret = bt_ctf_event_populate_event_header(event); if (ret) { - goto end; + goto error; } /* Make sure the various scopes of the event are set */ ret = bt_ctf_event_validate(event); if (ret) { - goto end; + goto error; } /* Save the new event and freeze it */ @@ -602,14 +602,17 @@ int bt_ctf_stream_append_event(struct bt_ctf_stream *stream, * longer needed. */ bt_put(event->event_class); + end: - if (ret) { - /* - * Orphan the event; we were not succesful in associating it to - * a stream. - */ - bt_object_set_parent(event, NULL); - } + return ret; + +error: + /* + * Orphan the event; we were not successful in associating it to + * a stream. + */ + bt_object_set_parent(event, NULL); + return ret; }