]> granicus.if.org Git - postgis/commitdiff
Move free before the report
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 5 Mar 2015 19:09:17 +0000 (19:09 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 5 Mar 2015 19:09:17 +0000 (19:09 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13314 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos.c

index 7d16dffc541394a1023aabab0f02460c2188efef..70f444aa907bf74d3eaf368fd39806f2c4398152 100644 (file)
@@ -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);
        }
 }