From: Paul Ramsey Date: Thu, 5 Mar 2015 19:09:17 +0000 (+0000) Subject: Move free before the report X-Git-Tag: 2.2.0rc1~615 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54a590d91a6bcfe2515dac8af55af5d169a4c0f3;p=postgis Move free before the report git-svn-id: http://svn.osgeo.org/postgis/trunk@13314 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 7d16dffc5..70f444aa9 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -1734,6 +1734,7 @@ void errorIfGeometryCollection(GSERIALIZED *g1, GSERIALIZED *g2) { lwgeom = lwgeom_from_gserialized(g1); hintwkt = lwgeom_to_wkt(lwgeom, WKT_SFSQL, DBL_DIG, &hintsz); + lwgeom_free(lwgeom); hintmsg = lwmessage_truncate(hintwkt, 0, hintsz-1, 80, 1); ereport(ERROR, (errmsg("Relate Operation called with a LWGEOMCOLLECTION type. This is unsupported."), @@ -1741,20 +1742,19 @@ void errorIfGeometryCollection(GSERIALIZED *g1, GSERIALIZED *g2) ); pfree(hintwkt); pfree(hintmsg); - lwgeom_free(lwgeom); } else if (t2 == COLLECTIONTYPE) { lwgeom = lwgeom_from_gserialized(g2); hintwkt = lwgeom_to_wkt(lwgeom, WKT_SFSQL, DBL_DIG, &hintsz); hintmsg = lwmessage_truncate(hintwkt, 0, hintsz-1, 80, 1); + lwgeom_free(lwgeom); ereport(ERROR, (errmsg("Relate Operation called with a LWGEOMCOLLECTION type. This is unsupported."), errhint("Change argument 2: '%s'", hintmsg)) ); pfree(hintwkt); pfree(hintmsg); - lwgeom_free(lwgeom); } }