commit 25a955c0c192c9d809bc3c956615f948c21b353d parent de89cfa39333a782338aff416883dbbd827c4209 Author: bsandro <email@bsandro.tech> Date: Sat, 16 Dec 2023 23:15:12 +0200 day 16 free() Diffstat:
M | day16/puzzle.c | | | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/day16/puzzle.c b/day16/puzzle.c @@ -64,8 +64,14 @@ bool visited_has(Visited *visited, Pos p) { } void visited_destroy(Visited *visited) { - //@todo - (void)visited; + Pos *cur = visited->first; + while (cur!=NULL) { + Pos *next = cur->next; + free(cur); + cur = next; + } + visited->first = NULL; + visited->last = NULL; } Pos get_next_empty(Pos cur) {