Commit 26bdf5c0 authored by Paul Ramsey's avatar Paul Ramsey

Delay freeing input until processing complete. From lucasvr.

References #3980


git-svn-id: http://svn.osgeo.org/postgis/trunk@16563 b70326c6-7e19-0410-871a-916f4a2858ee
parent 17708aa3
Pipeline #21647239 passed with stage
in 16 minutes and 57 seconds
......@@ -747,20 +747,19 @@ Datum sfcgal_is_solid(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(sfcgal_make_solid);
Datum sfcgal_make_solid(PG_FUNCTION_ARGS)
{
GSERIALIZED *output;
GSERIALIZED *output;
GSERIALIZED *input = PG_GETARG_GSERIALIZED_P(0);
LWGEOM *lwgeom = lwgeom_from_gserialized(input);
PG_FREE_IF_COPY(input, 0);
LWGEOM *lwgeom = lwgeom_from_gserialized(input);
if (! lwgeom)
{
elog(ERROR, "sfcgal_make_solid: Unable to deserialize input");
}
FLAGS_SET_SOLID( lwgeom->flags, 1);
FLAGS_SET_SOLID( lwgeom->flags, 1);
output = geometry_serialize( lwgeom );
lwgeom_free(lwgeom);
PG_FREE_IF_COPY(input, 0);
PG_RETURN_POINTER(output);
}
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