Fix: prevent calling adding the same trace recursively
[babeltrace.git] / formats / ctf / ctf.c
index c5d654c975f60a7ad74d3574eec377468ad185ce..0cdce8ef48ea365d323eeb23007448a2eeaad352 100644 (file)
@@ -426,7 +426,6 @@ void print_uuid(FILE *fp, unsigned char *uuid)
  * consumer had time to extract them. We keep track of those gaps with the
  * packet sequence number in each packet.
  */
-static
 void ctf_print_discarded_lost(FILE *fp, struct ctf_stream_definition *stream)
 {
        if ((!stream->events_discarded && !stream->packets_lost) ||
@@ -2431,8 +2430,10 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags,
 
        return &td->parent;
 error:
-       trace_debug_info_destroy(td);
-       g_free(td);
+       if (td) {
+               trace_debug_info_destroy(td);
+               g_free(td);
+       }
        return NULL;
 }
 
This page took 0.027608 seconds and 4 git commands to generate.