From 5d83d8f369dd5e92addf6e5d2f4106511c1e711e Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 19 Jun 2005 21:49:53 +0000 Subject: [PATCH] James Harvey's memory leak patch for Flip. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5980 cda61777-01e9-0310-a592-d414129be87e --- flip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flip.c b/flip.c index a5ee044..df1106c 100644 --- a/flip.c +++ b/flip.c @@ -590,6 +590,8 @@ static char *new_game_desc(game_params *params, random_state *rs, sprintf(ret, "%s,%s", mbmp, gbmp); sfree(mbmp); sfree(gbmp); + sfree(matrix); + sfree(grid); return ret; } @@ -731,6 +733,7 @@ static game_state *solve_game(game_state *state, game_state *currstate, if (equations[j * (wh+1) + wh]) { *error = "No solution exists for this position"; sfree(equations); + sfree(und); return NULL; } break; @@ -852,6 +855,7 @@ static game_state *solve_game(game_state *state, game_state *currstate, sfree(shortest); sfree(solution); sfree(equations); + sfree(und); return ret; } -- 2.11.0