From: Mathieu Desnoyers Date: Wed, 27 Nov 2013 09:22:54 +0000 (-0500) Subject: Fix: uncheck null pointer X-Git-Tag: v1.2.0-rc1~39^2~10 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=2f0c6a5248bb8c00adf37648c301e87f63709408 Fix: uncheck null pointer Found by coverity: ** CID 1132647: Dereference null return value (NULL_RETURNS) /formats/ctf/ctf.c: 1852 in ctf_open_file_stream_read() Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 75970885..317457e8 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1849,6 +1849,10 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, goto error_free; } file_stream->pos.index_fp = fdopen(ret, "r"); + if (!file_stream->pos.index_fp) { + perror("fdopen() error"); + goto error_free; + } ret = import_stream_packet_index(td, file_stream); if (ret) { ret = -1;