From 0a6f8b49723aa8da143953bc011582542d2f2010 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Thu, 26 Mar 2026 13:42:59 +0300 Subject: Fix memory leaks --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 74f6784..74d2af8 100644 --- a/main.c +++ b/main.c @@ -128,11 +128,13 @@ int main(int argc, char **argv) { case 'n': if (is_maze) { //FIXME: free it all before generating a new one + map_free(map, height); map = rbt_maze_map(mwidth, mheight, (unsigned int) time(NULL)); + path_free(path, height); path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, anim); } break; - case 'q': endwin(); return 0; + case 'q': map_free(map, height); path_free(path, height); endwin(); return 0; } } -- cgit v1.2.3