]> granicus.if.org Git - postgis/commitdiff
Variable declaration set in place in lwgeom_centroid()
authorSandro Santilli <strk@keybit.net>
Thu, 24 Mar 2005 16:28:48 +0000 (16:28 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 24 Mar 2005 16:28:48 +0000 (16:28 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1563 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_functions_basic.c

index 8d11d799af00447003a01e01d30a5c7d01aa7ec8..b0a83a0e952e21399f2ea003dc658604033ceca0 100644 (file)
@@ -2377,9 +2377,11 @@ Datum centroid(PG_FUNCTION_ARGS)
        PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
        LWGEOM *lwgeom = lwgeom_deserialize(SERIALIZED_FORM(geom));
        LWGEOM *centroid = lwgeom_centroid(lwgeom);
+       PG_LWGEOM *ret;
+
        lwgeom_release(lwgeom);
        if ( ! centroid ) PG_RETURN_NULL();
-       PG_LWGEOM *ret = pglwgeom_serialize(centroid);
+       ret = pglwgeom_serialize(centroid);
        lwgeom_release((LWGEOM *)centroid);
        PG_FREE_IF_COPY(geom, 0);
        PG_RETURN_POINTER(ret);