Commit 12fa0244 authored by Raúl Marín's avatar Raúl Marín

Fix memory leak in lwgeom_offsetcurve

Closes #4172
Closes https://github.com/postgis/postgis/pull/291


git-svn-id: http://svn.osgeo.org/postgis/trunk@16722 b70326c6-7e19-0410-871a-916f4a2858ee
parent b40f9133
Pipeline #29644684 passed with stage
in 22 minutes and 33 seconds
......@@ -7,6 +7,7 @@ PostGIS 3.0.0
radius in table (Darafei Praliaskouski, github user Boscop).
- #4163, MVT: Fix resource leak when the first geometry is NULL (Raúl Marín)
- #4161, MVT: Drop geometries smaller than the resolution (Raúl Marín)
- #4172, Fix memory leak in lwgeom_offsetcurve (Raúl Marín)
PostGIS 2.5.0rc1
2018/08/19
......
......@@ -1389,13 +1389,15 @@ lwgeom_offsetcurve(const LWGEOM* geom, double size, int quadsegs, int joinStyle,
}
if (result)
{
if (noded) lwgeom_free(noded);
return result;
}
else if (!noded)
{
noded = lwgeom_node(geom);
if (!noded)
{
lwfree(noded);
lwerror("lwgeom_offsetcurve: cannot node input");
return NULL;
}
......@@ -1403,10 +1405,12 @@ lwgeom_offsetcurve(const LWGEOM* geom, double size, int quadsegs, int joinStyle,
}
else
{
lwgeom_free(noded);
lwerror("lwgeom_offsetcurve: noded geometry cannot be offset");
return NULL;
}
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment