aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--path.c2
1 files changed, 2 insertions, 0 deletions
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;
}