X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fir%2Fvisitor.c;h=704a80488295fdde025083c00f887551cd122524;hb=364747d64a1a28873316e3933462e3373bbf15c8;hp=62195b64adb6f3e7561b88e585686c287f29efb3;hpb=5cec03e402aaee5fe314e03f366363a617a7d0c8;p=babeltrace.git diff --git a/formats/ctf/ir/visitor.c b/formats/ctf/ir/visitor.c index 62195b64..704a8048 100644 --- a/formats/ctf/ir/visitor.c +++ b/formats/ctf/ir/visitor.c @@ -273,10 +273,11 @@ int field_type_recursive_visit(struct bt_ctf_field_type *type, ctf_type_stack_peek(context->stack); int field_count = get_type_field_count(entry->type); - if (field_count <= 0) { + if (field_count <= 0 && + !bt_ctf_field_type_is_structure(entry->type)) { /* * Propagate error if one was given, else return - * -1 since empty structures or variants are invalid + * -1 since empty variants are invalid * at this point. */ ret = field_count < 0 ? field_count : -1; @@ -723,7 +724,8 @@ end: g_free(name_copy); } if (path_tokens) { - g_list_free_full(path_tokens, free); + g_list_foreach(path_tokens, (GFunc) free, NULL); + g_list_free(path_tokens); } return ret; error: