components collapse out of existence, they
need to be freed (References #3877)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15890
b70326c6-7e19-0410-871a-
916f4a2858ee
/* Skip bad rings */
if (pa->npoints < 4)
{
- /* If bad ring is external ring, stop everything */
+ ptarray_free(pa);
+ /* When internal rings collapse, we free */
+ /* then and move on */
if (i) continue;
+ /* If external ring collapses, we free */
+ /* it and stop processing */
else break;
}
/* Fill in just the rings we are keeping */
{
LWGEOM *g = col->geoms[i];
lwgeom_grid_in_place(g, grid);
- /* Skip empty geoms */
+ /* Empty geoms need to be freed */
+ /* before we move on */
if (lwgeom_is_empty(g))
+ {
+ lwgeom_free(g);
continue;
+ }
col->geoms[j++] = g;
}
col->ngeoms = j;