From 5b623c0a31d6732dd03ba8db80004e5468bc08c3 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sat, 28 Mar 2026 18:15:31 +0300 Subject: Free the path when we return NULL instead of it --- path.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/path.c b/path.c index 033f881..60f1482 100644 --- a/path.c +++ b/path.c @@ -76,6 +76,7 @@ Path breadth_first_search_path(int dirs, Map map, size_t width, size_t height, P if (should_anim) { if (anim(map, width, height, start, end, &cur, visited, frontier) == -1) { clear(); + path_free(path, height); return NULL; } } @@ -85,6 +86,7 @@ Path breadth_first_search_path(int dirs, Map map, size_t width, size_t height, P clear(); } + path_free(path, height); return NULL; } -- cgit v1.2.3