Fix: check for NULL in destroy_pretty_data
[babeltrace.git] / src / plugins / text / pretty / pretty.c
index 3f693e5a815d524f000998a304cbeb3241419789..a925b7d8fce9b9c9b936ef535b0e007d2b253882 100644 (file)
@@ -48,6 +48,10 @@ void destroy_pretty_data(struct pretty_component *pretty)
 {
        bt_self_component_port_input_message_iterator_put_ref(pretty->iterator);
 
+       if (!pretty) {
+               goto end;
+       }
+
        if (pretty->string) {
                (void) g_string_free(pretty->string, TRUE);
        }
@@ -66,6 +70,9 @@ void destroy_pretty_data(struct pretty_component *pretty)
        }
        g_free(pretty->options.output_path);
        g_free(pretty);
+
+end:
+       return;
 }
 
 static
This page took 0.022937 seconds and 4 git commands to generate.