Fix: missing allocation error check
[babeltrace.git] / formats / ctf / ir / stream.c
index a903264963572ecc89279cb4b8f14781687ce909..70e2ec2a0ab0218d4190955e09a3ceb67dbb3709 100644 (file)
@@ -312,6 +312,9 @@ struct bt_ctf_stream *bt_ctf_stream_create(
        /* A trace is not allowed to have a NULL packet header */
        assert(trace->packet_header_type);
        stream->packet_header = bt_ctf_field_create(trace->packet_header_type);
+       if (!stream->packet_header) {
+               goto error_destroy;
+       }
        /*
         * Attempt to populate the default trace packet header fields
         * (magic, uuid and stream_id). This will _not_ fail shall the
This page took 0.023214 seconds and 4 git commands to generate.