[postgis-tickets] r16564 - Delay freeing input until processing is complete. From lucasvr.

Paul Ramsey pramsey at cleverelephant.ca
Mon May 7 11:59:40 PDT 2018


Author: pramsey
Date: 2018-05-07 11:59:40 -0700 (Mon, 07 May 2018)
New Revision: 16564

Modified:
   branches/2.4/NEWS
   branches/2.4/postgis/lwgeom_sfcgal.c
Log:
Delay freeing input until processing is complete. From lucasvr.
Closes #3980


Modified: branches/2.4/NEWS
===================================================================
--- branches/2.4/NEWS	2018-05-07 18:58:50 UTC (rev 16563)
+++ branches/2.4/NEWS	2018-05-07 18:59:40 UTC (rev 16564)
@@ -6,6 +6,7 @@
   - #4071, ST_ClusterKMeans crash on NULL/EMPTY fixed (Darafei Praliaskouski)
   - #4079, ensure St_AsMVTGeom outputs CW oriented polygons (Paul Ramsey)
   - #4070, use standard interruption error code on GEOS interruptions (Paul Ramsey)
+  - #3980, delay freeing input until processing complete (lucasvr)
 
 
 PostGIS 2.4.4

Modified: branches/2.4/postgis/lwgeom_sfcgal.c
===================================================================
--- branches/2.4/postgis/lwgeom_sfcgal.c	2018-05-07 18:58:50 UTC (rev 16563)
+++ branches/2.4/postgis/lwgeom_sfcgal.c	2018-05-07 18:59:40 UTC (rev 16564)
@@ -746,20 +746,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