Fix: missing allocation error check
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Mar 2015 05:07:11 +0000 (01:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 13 Mar 2015 05:17:44 +0000 (01:17 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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.027282 seconds and 4 git commands to generate.