Fix two memory leaks reported by Tiago Dionizio in recent Loopy

development.

[originally from svn r9163]
This commit is contained in:
Simon Tatham
2011-04-26 13:44:27 +00:00
parent 8266b71475
commit 4bab5e531b
2 changed files with 10 additions and 0 deletions

8
grid.c
View File

@ -453,6 +453,14 @@ static void grid_trim_vigorously(grid *g)
for (i = newdots = 0; i < g->num_dots; i++)
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.
*/