From 2f0c6a5248bb8c00adf37648c301e87f63709408 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 27 Nov 2013 04:22:54 -0500 Subject: [PATCH] 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 --- formats/ctf/ctf.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.34.1