aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-06-19 21:49:53 +0000
committerSimon Tatham <anakin@pobox.com>2005-06-19 21:49:53 +0000
commit0417e6335e33c99b84561b17aeba68c118c6f94f (patch)
tree8fef9a2ab2ffd679fc5258b73e960d5f43406093
parentdb88c9b9a4d210c26c34bf05efd6c00df584537b (diff)
downloadpuzzles-0417e6335e33c99b84561b17aeba68c118c6f94f.zip
puzzles-0417e6335e33c99b84561b17aeba68c118c6f94f.tar.gz
puzzles-0417e6335e33c99b84561b17aeba68c118c6f94f.tar.bz2
puzzles-0417e6335e33c99b84561b17aeba68c118c6f94f.tar.xz
James Harvey's memory leak patch for Flip.
[originally from svn r5980]
-rw-r--r--flip.c4
1 files changed, 4 insertions, 0 deletions
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;
}