[SCM] PostGIS branch stable-3.5 updated. 3.5.3-32-gf8b2f26d5

git at osgeo.org git at osgeo.org
Tue Jul 15 19:16:38 PDT 2025


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.5 has been updated
       via  f8b2f26d551b09c15e3945fdbdab4be86bdebb26 (commit)
       via  94be5abdd00896b1e1316611519b3339fa5a6fc0 (commit)
      from  d11ce63dfbd4a76527624bb01b82ff2e99a2c5db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f8b2f26d551b09c15e3945fdbdab4be86bdebb26
Author: Regina Obe <lr at pcorp.us>
Date:   Tue Jul 15 22:16:22 2025 -0400

    Add credits. References #5943 for PostGIS 3.5.4

diff --git a/NEWS b/NEWS
index 4f34dba7a..fa06b7ad5 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required.
 - #5939, incorrect parameter order in ST_Relate caching (Paul Ramsey)
 - #5927, ST_IsCollection throwing exception (Paul Ramsey)
 - #5902, ST_PointFromText cannot create geometries with M (Paul Ramsey)
+- #5943, Memory leak in handling GEOS GeometryFactory (Megan Ma)
 
 
 PostGIS 3.5.3
diff --git a/doc/introduction.xml b/doc/introduction.xml
index 1f0e2ba18..d0ba50772 100644
--- a/doc/introduction.xml
+++ b/doc/introduction.xml
@@ -307,6 +307,7 @@
 					<member>Maxime Guillaud</member>
 					<member>Maxime van Noppen</member>
 					<member>Maxime Schoemans</member>
+					<member>Megan Ma</member>
 					<member>Michael Fuhr</member>
 					<member>Mike Toews</member>
 					<member>Nathan Wagner</member>

commit 94be5abdd00896b1e1316611519b3339fa5a6fc0
Author: Regina Obe <lr at pcorp.us>
Date:   Tue Jul 15 22:01:43 2025 -0400

    Fix for GEOS GeometryFactory memory leak
    Contributed by: Megan Ma
    References #5943 for PostGIS 3.5.4

diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index ed3c314b8..102ed604d 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -723,7 +723,7 @@ lwgeom_intersection_prec(const LWGEOM* geom1, const LWGEOM* geom2, double prec)
 		g3 = GEOSIntersection(g1, g2);
 	}
 
-	if (!g3) GEOS_FREE_AND_FAIL(g1);
+	if (!g3) GEOS_FREE_AND_FAIL(g1, g2);
 	GEOSSetSRID(g3, srid);
 
 	if (!(result = GEOS2LWGEOM(g3, is3d))) GEOS_FREE_AND_FAIL(g1, g2, g3);
@@ -1145,7 +1145,7 @@ lwgeom_buildarea(const LWGEOM* geom)
 	/* If no geometries are in result collection, return NULL */
 	if (GEOSGetNumGeometries(g3) == 0)
 	{
-		GEOS_FREE(g1);
+		GEOS_FREE(g1, g3);
 		return NULL;
 	}
 
diff --git a/postgis/lwgeom_geos_predicates.c b/postgis/lwgeom_geos_predicates.c
index 3b918dab7..cb6dedac8 100644
--- a/postgis/lwgeom_geos_predicates.c
+++ b/postgis/lwgeom_geos_predicates.c
@@ -1002,7 +1002,11 @@ Datum relate_full(PG_FUNCTION_ARGS)
 	POSTGIS_DEBUGF(3, "%s", GEOSGeomToWKT(g2));
 
 	relate_str = GEOSRelateBoundaryNodeRule(g1, g2, bnr);
-	if (!relate_str) HANDLE_GEOS_ERROR("GEOSRelate");
+	if (!relate_str) {
+		GEOSGeom_destroy(g1);
+		GEOSGeom_destroy(g2);
+		HANDLE_GEOS_ERROR("GEOSRelate");
+	}
 	result = cstring_to_text(relate_str);
 	GEOSFree(relate_str);
 	GEOSGeom_destroy(g1);

-----------------------------------------------------------------------

Summary of changes:
 NEWS                             | 1 +
 doc/introduction.xml             | 1 +
 liblwgeom/lwgeom_geos.c          | 4 ++--
 postgis/lwgeom_geos_predicates.c | 6 +++++-
 4 files changed, 9 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list