lwgeom_out = lwgeom_buildarea(lwgeom_in);
lwgeom_free(lwgeom_in) ;
- PG_FREE_IF_COPY(geom, 0);
if ( ! lwgeom_out ) {
+ PG_FREE_IF_COPY(geom, 0);
PG_RETURN_NULL();
}
result = geometry_serialize(lwgeom_out) ;
lwgeom_free(lwgeom_out) ;
+ PG_FREE_IF_COPY(geom, 0);
PG_RETURN_POINTER(result);
}
lwgeom_out = lwgeom_split(lwgeom_in, lwblade_in);
lwgeom_free(lwgeom_in);
lwgeom_free(lwblade_in);
- PG_FREE_IF_COPY(blade_in, 1);
if ( ! lwgeom_out )
{
PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */
+ PG_FREE_IF_COPY(blade_in, 1);
PG_RETURN_NULL();
}
out = geometry_serialize(lwgeom_out);
lwgeom_free(lwgeom_out);
PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */
+ PG_FREE_IF_COPY(blade_in, 1);
PG_RETURN_POINTER(out);
}
lwgeom_out = lwgeom_sharedpaths(g1, g2);
lwgeom_free(g1);
lwgeom_free(g2);
- PG_FREE_IF_COPY(geom1, 0);
- PG_FREE_IF_COPY(geom2, 1);
if ( ! lwgeom_out )
{
+ PG_FREE_IF_COPY(geom1, 0);
+ PG_FREE_IF_COPY(geom2, 1);
PG_RETURN_NULL();
}
out = geometry_serialize(lwgeom_out);
lwgeom_free(lwgeom_out);
+ PG_FREE_IF_COPY(geom1, 0);
+ PG_FREE_IF_COPY(geom2, 1);
PG_RETURN_POINTER(out);
#endif /* POSTGIS_GEOS_VERSION >= 33 */
lwgeom_out = lwgeom_node(g1);
lwgeom_free(g1);
- PG_FREE_IF_COPY(geom1, 0);
if ( ! lwgeom_out )
{
+ PG_FREE_IF_COPY(geom1, 0);
PG_RETURN_NULL();
}
out = geometry_serialize(lwgeom_out);
lwgeom_free(lwgeom_out);
+ PG_FREE_IF_COPY(geom1, 0);
PG_RETURN_POINTER(out);
#endif /* POSTGIS_GEOS_VERSION >= 33 */
igeom = lwgeom_from_gserialized(geom);
ogeom = lwgeom_desegmentize(igeom);
lwgeom_free(igeom);
- PG_FREE_IF_COPY(geom, 0);
if (ogeom == NULL)
+ {
+ PG_FREE_IF_COPY(geom, 0);
PG_RETURN_NULL();
+ }
ret = geometry_serialize(ogeom);
lwgeom_free(ogeom);
+ PG_FREE_IF_COPY(geom, 0);
PG_RETURN_POINTER(ret);
}