From 770c718c21f2ee8cbf99969eceb7c9a52b9f15f2 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 8 Feb 2012 09:36:46 +0000 Subject: [PATCH] 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 --- postgis/lwgeom_geos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.40.0