From f4388f44291cb03f05de92ff2053817b26e5e51a Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 26 Dec 2017 13:26:40 +0100 Subject: [PATCH] free equipments, fewer leaks. --- src/kernel/equipment.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kernel/equipment.c b/src/kernel/equipment.c index f24d4acfd..b3cde8fb7 100644 --- a/src/kernel/equipment.c +++ b/src/kernel/equipment.c @@ -292,7 +292,12 @@ static void free_equipment(equipment *eq) { free(eq->items); eq->items = next; } - /* TODO: subsets, skills */ + if (eq->subsets) { + for (i = 0; eq->subsets[i].sets; ++i) { + free(eq->subsets[i].sets); + } + free(eq->subsets); + } for (i = 0; i != MAXSKILLS; ++i) { free(eq->skills[i]); }