When a void typespec is generated in a context where it is invalid,
gen_typespecs just rolls the dice again. Unfortunately, the typespec
is not freed in this case, leaking memory. Easily fixed.
switch (specs->type) {
/* void is not always valid, so we might need to pick again. */
case CDECL_TYPE_VOID:
- if (!voidtype)
+ if (!voidtype) {
+ assert(!specs->next);
+ free(specs);
goto retry;
+ }
break;
/* A few kinds of type specifiers need identifiers to go with them. */
case CDECL_TYPE_STRUCT: