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