]> granicus.if.org Git - postgis/commitdiff
Early memory release in transform_geom
authorSandro Santilli <strk@keybit.net>
Fri, 11 Mar 2005 17:56:01 +0000 (17:56 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 11 Mar 2005 17:56:01 +0000 (17:56 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1532 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_transform.c

index 8260804c257650ff390712fe604dc2dde376fcc7..d0168583c81a6cd1ed33ec08800ab6665b2fdea4 100644 (file)
@@ -325,6 +325,7 @@ Datum transform_geom(PG_FUNCTION_ARGS)
                lwgeom_dropBBOX(lwgeom);
                lwgeom->bbox = lwgeom_compute_bbox(lwgeom);
                lwgeom->SRID = result_srid;
+               lwgeom_release(lwgeom);
                result = pglwgeom_serialize(lwgeom);
        }
        else
@@ -332,6 +333,8 @@ Datum transform_geom(PG_FUNCTION_ARGS)
                result = PG_LWGEOM_construct(srl, result_srid, 0);
        }
 
+       pfree(geom);
+
        PG_RETURN_POINTER(result); // new geometry
 }