Fix: Don't dereference null ptr in error path
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 17 May 2016 19:09:03 +0000 (15:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 30 May 2016 06:00:19 +0000 (02:00 -0400)
Fixes coverity #1355339

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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.033367 seconds and 4 git commands to generate.