diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-28 18:15:31 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-28 18:15:31 +0300 |
| commit | 5b623c0a31d6732dd03ba8db80004e5468bc08c3 (patch) | |
| tree | a997548d546d6a8615a2d9afcbf94477bd901e9c | |
| parent | 788744ac322684b64a02e4661bde59e4e565afa2 (diff) | |
| download | astar-5b623c0a31d6732dd03ba8db80004e5468bc08c3.tar.xz | |
Free the path when we return NULL instead of it
| -rw-r--r-- | path.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |
