summaryrefslogtreecommitdiff
path: root/identifiers.c
diff options
context:
space:
mode:
Diffstat (limited to 'identifiers.c')
-rw-r--r--identifiers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/identifiers.c b/identifiers.c
index 6c17cd7..9b9fff0 100644
--- a/identifiers.c
+++ b/identifiers.c
@@ -214,8 +214,10 @@ static IdentDecl *ident_decl(Identifier i) {
}
static void idents_free(Identifiers *ids) {
- arr_foreach(ids->slots, IdentSlotPtr, slot) {
- free(*slot);
+ arr_foreach(ids->slots, IdentSlotPtr, slotp) {
+ IdentSlot *slot = *slotp;
+ if (slot) arr_clear(&slot->decls);
+ free(slot);
}
arr_clear(&ids->slots);
}