diff options
| author | Simon Tatham <anakin@pobox.com> | 2007-05-12 08:26:58 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2007-05-12 08:26:58 +0000 |
| commit | 5b8b85537621204a12962c4b3afb708a24817a54 (patch) | |
| tree | 91524df6efd8fbdd56ace49f2c9c5bfb8eaf1ff5 | |
| parent | 81e3a145bff031c0bb010a3678870990ae915faf (diff) | |
| download | puzzles-5b8b85537621204a12962c4b3afb708a24817a54.zip puzzles-5b8b85537621204a12962c4b3afb708a24817a54.tar.gz puzzles-5b8b85537621204a12962c4b3afb708a24817a54.tar.bz2 puzzles-5b8b85537621204a12962c4b3afb708a24817a54.tar.xz | |
Fix tiny memory leak if you pressed Solve while part way through an
existing solution path.
[originally from svn r7571]
| -rw-r--r-- | inertia.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1626,6 +1626,10 @@ static game_state *execute_move(game_state *state, char *move) sol->list[i] = move[i] - '0'; ret = dup_game(state); ret->cheated = TRUE; + if (ret->soln && --ret->soln->refcount == 0) { + sfree(ret->soln->list); + sfree(ret->soln); + } ret->soln = sol; ret->solnpos = 0; sol->refcount = 1; |