mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Fix tiny memory leak if you pressed Solve while part way through an
existing solution path. [originally from svn r7571]
This commit is contained in:
@ -1626,6 +1626,10 @@ static game_state *execute_move(game_state *state, char *move)
|
|||||||
sol->list[i] = move[i] - '0';
|
sol->list[i] = move[i] - '0';
|
||||||
ret = dup_game(state);
|
ret = dup_game(state);
|
||||||
ret->cheated = TRUE;
|
ret->cheated = TRUE;
|
||||||
|
if (ret->soln && --ret->soln->refcount == 0) {
|
||||||
|
sfree(ret->soln->list);
|
||||||
|
sfree(ret->soln);
|
||||||
|
}
|
||||||
ret->soln = sol;
|
ret->soln = sol;
|
||||||
ret->solnpos = 0;
|
ret->solnpos = 0;
|
||||||
sol->refcount = 1;
|
sol->refcount = 1;
|
||||||
|
Reference in New Issue
Block a user