diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-26 13:42:59 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-26 13:42:59 +0300 |
| commit | 0a6f8b49723aa8da143953bc011582542d2f2010 (patch) | |
| tree | d2fb6216ff0815a8539d3b315e188181e98bbf89 /main.c | |
| parent | 5bf01bf1955cb1be6dc498543f8b2064b3424177 (diff) | |
| download | astar-0a6f8b49723aa8da143953bc011582542d2f2010.tar.xz | |
Fix memory leaks
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } } |
