str = g_string_new("");
ret = visit_type_specifier_list(fd, type_specifier_list, str);
- if (ret)
+ if (ret) {
+ (void) g_string_free(str, TRUE);
return NULL;
+ }
str_c = g_string_free(str, FALSE);
id_q = g_quark_from_string(str_c);
g_free(str_c);
declaration = bt_lookup_declaration(id_q, declaration_scope);
+ if (!declaration)
+ return NULL;
bt_declaration_ref(declaration);
return declaration;
}