From 9235146064cacb819bbb4edbebed1e41952eb77c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 13 Mar 2015 01:07:11 -0400 Subject: [PATCH] Fix: missing allocation error check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- formats/ctf/ir/stream.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.34.1