X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=types%2Ftypes.c;h=8272b8147db08fdc822a153d44050beabd9fb19c;hp=b766f8d8d4cb415e23011c82eaf217ded71b110a;hb=6ee5115efee00adab0c8f384bc9c0f38fed8a84e;hpb=e19c3d69b39d2fa422ab54b5ec7192799f536680 diff --git a/types/types.c b/types/types.c index b766f8d8..8272b814 100644 --- a/types/types.c +++ b/types/types.c @@ -49,11 +49,14 @@ static void free_type(struct type *type) static void free_declaration(struct declaration *declaration) { - declaration->p.declaration_free(declaration); + declaration->type->declaration_free(declaration); } int register_type(struct type *type, struct declaration_scope *scope) { + if (!type->name) + return -EPERM; + /* Only lookup in local scope */ if (lookup_type_scope(type->name, scope)) return -EEXIST;