From: Jérémie Galarneau Date: Fri, 13 Mar 2015 05:07:11 +0000 (-0400) Subject: Fix: missing allocation error check X-Git-Tag: v2.0.0-pre1~1333 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9235146064cacb819bbb4edbebed1e41952eb77c Fix: missing allocation error check Signed-off-by: Jérémie Galarneau --- diff --git a/formats/ctf/ir/stream.c b/formats/ctf/ir/stream.c index a9032649..70e2ec2a 100644 --- a/formats/ctf/ir/stream.c +++ b/formats/ctf/ir/stream.c @@ -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