From e8f215126791c763c3168b9bb9083294a42b606c Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Thu, 2 May 2013 05:32:06 +0200 Subject: [PATCH] Cleaning up at the end to eliminate memory leaks detected by valgrind. --- roguelike.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roguelike.c b/roguelike.c index 7d535bc..6d75aa9 100644 --- a/roguelike.c +++ b/roguelike.c @@ -416,5 +416,13 @@ int main () { update_info (&win_info); update_log (&win_log, "\nYou wait."); } } + free(map.cells); + for (key = 0; key <= world.keyswindata->max; key++) + free(world.keybindings[key].name); + free(world.keybindings); + free(world.keyswindata); + free(win_info.data); + free(win_log.data); + endwin(); return 0; } -- 2.30.2