[postgis-tickets] r16563 - Delay freeing input until processing complete. From lucasvr.
Paul Ramsey
pramsey at cleverelephant.ca
Mon May 7 11:58:50 PDT 2018
Author: pramsey
Date: 2018-05-07 11:58:50 -0700 (Mon, 07 May 2018)
New Revision: 16563
Modified:
trunk/postgis/lwgeom_sfcgal.c
Log:
Delay freeing input until processing complete. From lucasvr.
References #3980
Modified: trunk/postgis/lwgeom_sfcgal.c
===================================================================
--- trunk/postgis/lwgeom_sfcgal.c 2018-05-07 18:47:53 UTC (rev 16562)
+++ trunk/postgis/lwgeom_sfcgal.c 2018-05-07 18:58:50 UTC (rev 16563)
@@ -747,20 +747,19 @@
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);
}
More information about the postgis-tickets
mailing list