]> granicus.if.org Git - postgis/commitdiff
Clone LWGEOM in aggregation step
authorBjörn Harrtell <bjorn@wololo.org>
Sun, 5 Mar 2017 11:58:54 +0000 (11:58 +0000)
committerBjörn Harrtell <bjorn@wololo.org>
Sun, 5 Mar 2017 11:58:54 +0000 (11:58 +0000)
References #3720

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

postgis/geobuf.c

index b0c4b3242d13a2f066c7e8b5be6a3e734fc719de..e9f9aa1b27f9e7613d42a698122ee04f54f63d2d 100644 (file)
@@ -540,7 +540,7 @@ void geobuf_agg_transfn(struct geobuf_agg_context *ctx)
        if (!datum)
                lwerror("geobuf_agg_transfn: geometry column cannot be null");
        gs = (GSERIALIZED *) PG_DETOAST_DATUM(datum);
-       lwgeom = lwgeom_from_gserialized(gs);
+       lwgeom = lwgeom_clone_deep(lwgeom_from_gserialized(gs));
 
        feature = encode_feature(ctx);