Fix: Don't dereference null ptr in error path
[babeltrace.git] / formats / ctf / ctf.c
index c5d654c975f60a7ad74d3574eec377468ad185ce..bc96212149c47260ca5af36b73fa4458c0ffe27e 100644 (file)
@@ -2431,8 +2431,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.02245 seconds and 4 git commands to generate.