From 230da7433d746d56c6837b44794531c1bbee74e1 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 18 Jul 2011 16:23:14 -0400 Subject: [PATCH] Fix segfault when typealias fails Signed-off-by: Simon Marchi Signed-off-by: Mathieu Desnoyers --- formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c index bdb5c68d6..cda3329be 100644 --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c @@ -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; } -- 2.34.1