ctf.fs: bt_ctf_notif_iter_create(): assert() that all medops exist
[babeltrace.git] / formats / ctf / ir / stream.c
index 845153c13399a190b35dd17392c7af840ae180b6..b4d234703e1bb27d7725bb7ab9530232e2847dc4 100644 (file)
@@ -876,6 +876,7 @@ void reset_structure_field(struct bt_ctf_field *structure, const char *name)
        member = bt_ctf_field_structure_get_field(structure, name);
        assert(member);
        (void) bt_ctf_field_reset(member);
+       bt_put(member);
 }
 
 int bt_ctf_stream_flush(struct bt_ctf_stream *stream)
@@ -1059,6 +1060,16 @@ end:
                                "content_size");
        }
        bt_put(integer);
+
+       if (ret < 0) {
+               /*
+                * We failed to write the packet. Its size is therefore set to 0
+                * to ensure the next mapping is done in the same place rather
+                * than advancing by "stream->pos.packet_size", which would
+                * leave a corrupted packet in the trace.
+                */
+               stream->pos.packet_size = 0;
+       }
        return ret;
 }
 
This page took 0.029886 seconds and 4 git commands to generate.