Fix segfault when typealias fails
[babeltrace.git] / formats / ctf / metadata / ctf-visitor-generate-io-struct.c
index bdb5c68d6cfaa45ec3395fc7ad408eb23ff9792a..cda3329be4455be450b31d611ce0c8e0dee23690 100644 (file)
@@ -584,7 +584,9 @@ int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope,
        return 0;
 
 error:
-       type_declaration->declaration_free(type_declaration);
+       if (type_declaration) {
+               type_declaration->declaration_free(type_declaration);
+       }
        return err;
 }
 
This page took 0.022952 seconds and 4 git commands to generate.