mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
James Harvey's memory leak patch for Flip.
[originally from svn r5980]
This commit is contained in:
4
flip.c
4
flip.c
@ -590,6 +590,8 @@ static char *new_game_desc(game_params *params, random_state *rs,
|
|||||||
sprintf(ret, "%s,%s", mbmp, gbmp);
|
sprintf(ret, "%s,%s", mbmp, gbmp);
|
||||||
sfree(mbmp);
|
sfree(mbmp);
|
||||||
sfree(gbmp);
|
sfree(gbmp);
|
||||||
|
sfree(matrix);
|
||||||
|
sfree(grid);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -731,6 +733,7 @@ static game_state *solve_game(game_state *state, game_state *currstate,
|
|||||||
if (equations[j * (wh+1) + wh]) {
|
if (equations[j * (wh+1) + wh]) {
|
||||||
*error = "No solution exists for this position";
|
*error = "No solution exists for this position";
|
||||||
sfree(equations);
|
sfree(equations);
|
||||||
|
sfree(und);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -852,6 +855,7 @@ static game_state *solve_game(game_state *state, game_state *currstate,
|
|||||||
sfree(shortest);
|
sfree(shortest);
|
||||||
sfree(solution);
|
sfree(solution);
|
||||||
sfree(equations);
|
sfree(equations);
|
||||||
|
sfree(und);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user