James Harvey's memory leak patch for Flip.

[originally from svn r5980]
This commit is contained in:
Simon Tatham
2005-06-19 21:49:53 +00:00
parent db88c9b9a4
commit 0417e6335e

4
flip.c
View File

@ -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;
}