]> granicus.if.org Git - postgis/commitdiff
Use PG_DETOAST_DATUM_COPY instead of clone deep
authorBjörn Harrtell <bjorn@wololo.org>
Mon, 6 Mar 2017 20:40:10 +0000 (20:40 +0000)
committerBjörn Harrtell <bjorn@wololo.org>
Mon, 6 Mar 2017 20:40:10 +0000 (20:40 +0000)
References #3720

git-svn-id: http://svn.osgeo.org/postgis/trunk@15322 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geobuf.c

index e9f9aa1b27f9e7613d42a698122ee04f54f63d2d..7a2c1d8969d4dcc6ea65e207c90742d33030800c 100644 (file)
@@ -539,8 +539,8 @@ void geobuf_agg_transfn(struct geobuf_agg_context *ctx)
        datum = GetAttributeByNum(ctx->row, ctx->geom_index + 1, &isnull);
        if (!datum)
                lwerror("geobuf_agg_transfn: geometry column cannot be null");
-       gs = (GSERIALIZED *) PG_DETOAST_DATUM(datum);
-       lwgeom = lwgeom_clone_deep(lwgeom_from_gserialized(gs));
+       gs = (GSERIALIZED *) PG_DETOAST_DATUM_COPY(datum);
+       lwgeom = lwgeom_from_gserialized(gs);
 
        feature = encode_feature(ctx);