Fix null stream handling
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 23 May 2011 14:10:14 +0000 (10:10 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 23 May 2011 14:10:14 +0000 (10:10 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 730e2a3ae1fee0a7613475d38e1bedd22d0649a3..5e43d2fa867cce377f14cf9869929ef20afd79bd 100644 (file)
@@ -52,7 +52,9 @@
 
 extern int yydebug;
 
+static
 struct trace_descriptor *ctf_open_trace(const char *path, int flags);
+static
 void ctf_close_trace(struct trace_descriptor *descriptor);
 
 static
@@ -907,6 +909,7 @@ error:
        return ret;
 }
 
+static
 struct trace_descriptor *ctf_open_trace(const char *path, int flags)
 {
        struct ctf_trace *td;
@@ -945,6 +948,7 @@ void ctf_close_file_stream(struct ctf_file_stream *file_stream)
        close(file_stream->pos.fd);
 }
 
+static
 void ctf_close_trace(struct trace_descriptor *tdp)
 {
        struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent);
@@ -954,7 +958,10 @@ void ctf_close_trace(struct trace_descriptor *tdp)
                for (i = 0; i < td->streams->len; i++) {
                        struct ctf_stream_class *stream;
                        int j;
+
                        stream = g_ptr_array_index(td->streams, i);
+                       if (!stream)
+                               continue;
                        for (j = 0; j < stream->files->len; j++) {
                                struct ctf_file_stream *file_stream;
                                file_stream = g_ptr_array_index(stream->files, j);
This page took 0.02576 seconds and 4 git commands to generate.