From 7082ce3565749976e9b2d6129778d88f55e3e198 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Tue, 25 Jan 2022 13:46:48 +0100 Subject: [PATCH] day 21: fix memory leaks --- 2021/day21/aoc-c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2021/day21/aoc-c.c b/2021/day21/aoc-c.c index c7287eb..8b42bca 100644 --- a/2021/day21/aoc-c.c +++ b/2021/day21/aoc-c.c @@ -193,10 +193,9 @@ static u64 part2() enqueue(new); } } - } - } + pool_add(pool_queue, queue); } return count1 > count2? count1: count2; } @@ -236,6 +235,7 @@ int main(int ac, char **av) read_input(); printf("%s : res=%ld\n", *av, part == 1? part1(): part2()); + pool_destroy(pool_queue); exit(0); }