Fix: ctf-writer: null dereference in bt_ctf_trace_common_add_stream_class
[babeltrace.git] / src / ctf-writer / trace.c
index 804af24dc1819192e9451876f8cec190c828da63..482d81d84dcb6776cb37dd3318095f0c9c3ca9c6 100644 (file)
@@ -1240,7 +1240,9 @@ int bt_ctf_trace_common_add_stream_class(struct bt_ctf_trace_common *trace,
 
 end:
        if (ret) {
-               bt_ctf_object_set_parent(&stream_class->base, NULL);
+               if (stream_class) {
+                       bt_ctf_object_set_parent(&stream_class->base, NULL);
+               }
 
                if (ec_validation_outputs) {
                        for (i = 0; i < event_class_count; i++) {
This page took 0.023487 seconds and 4 git commands to generate.