From: Sandro Santilli Date: Wed, 8 Feb 2012 09:36:46 +0000 (+0000) Subject: Do not release serialized input until output is deserialized X-Git-Tag: 2.0.0alpha4~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=770c718c21f2ee8cbf99969eceb7c9a52b9f15f2;p=postgis Do not release serialized input until output is deserialized See http://postgis.refractions.net/pipermail/postgis-devel/2012-February/018336.html git-svn-id: http://svn.osgeo.org/postgis/trunk@9095 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index bc7dfc7e7..5f4e370b2 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -3493,16 +3493,17 @@ Datum ST_Split(PG_FUNCTION_ARGS) lwgeom_out = lwgeom_split(lwgeom_in, lwblade_in); lwgeom_free(lwgeom_in); lwgeom_free(lwblade_in); - PG_FREE_IF_COPY(in, 0); PG_FREE_IF_COPY(blade_in, 1); if ( ! lwgeom_out ) { + PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */ PG_RETURN_NULL(); } out = geometry_serialize(lwgeom_out); lwgeom_free(lwgeom_out); + PG_FREE_IF_COPY(in, 0); /* possibly referenced by lwgeom_out */ PG_RETURN_POINTER(out); }