Track clock states in notification iterator
[babeltrace.git] / formats / ctf / ir / stream.c
index e9ff83e4982e2521b41c4de40b982ab1715cd810..8c5a9877fb3dceae1aadf01aae9476a868d93a0a 100644 (file)
@@ -579,13 +579,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 */
@@ -599,14 +599,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;
 }
 
@@ -930,6 +933,7 @@ void bt_ctf_stream_destroy(struct bt_object *obj)
        if (stream->name) {
                g_string_free(stream->name, TRUE);
        }
+
        bt_put(stream->packet_header);
        bt_put(stream->packet_context);
        g_free(stream);
This page took 0.026554 seconds and 4 git commands to generate.