X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/18eb897ff68aef4a40e0c966dbcfb7148a12759e..a6bd4b9c9f5c5918bf56b50c5d31a4c31104c2ec:/grid.c diff --git a/grid.c b/grid.c index d73e521..d7e6442 100644 --- a/grid.c +++ b/grid.c @@ -454,6 +454,14 @@ static void grid_trim_vigorously(grid *g) dots[i] = (dots[i] ? newdots++ : -1); /* + * Free the dynamically allocated 'dots' pointer lists in faces + * we're going to discard. + */ + for (i = 0; i < g->num_faces; i++) + if (faces[i] < 0) + sfree(g->faces[i].dots); + + /* * Go through and compact the arrays. */ for (i = 0; i < g->num_dots; i++)