Fix: uncheck null pointer
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 27 Nov 2013 09:22:54 +0000 (04:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 27 Nov 2013 09:22:54 +0000 (04:22 -0500)
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 <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 759708856b0a2044c4802325d2a2434ae0525287..317457e883c5d7dab6271d3b5c430281e96ca987 100644 (file)
@@ -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;
This page took 0.025398 seconds and 4 git commands to generate.