chiark
/
gitweb
/
~ian
/
sgt-puzzles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81e3a14
)
Fix tiny memory leak if you pressed Solve while part way through an
author
Simon Tatham
<anakin@pobox.com>
Sat, 12 May 2007 08:26:58 +0000
(08:26 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Sat, 12 May 2007 08:26:58 +0000
(08:26 +0000)
existing solution path.
[originally from svn r7571]
inertia.c
patch
|
blob
|
history
diff --git
a/inertia.c
b/inertia.c
index 4e84f56f3a1f7ed4664995c2d191db7974fe07c5..dd80ebef1c04961fa25746941332fe22632255a5 100644
(file)
--- a/
inertia.c
+++ b/
inertia.c
@@
-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;