[SCM] PostGIS branch master updated. 3.7.0beta1-272-gff62ffc93a

git at osgeo.org git at osgeo.org
Sun Aug 9 09:33:40 PDT 2026


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, master has been updated
       via  ff62ffc93adaccbee6aed555ec2e83561d4da1fa (commit)
       via  94cc593de819c917edc0d0a49c9c2ee76a5f88ce (commit)
      from  f03f1cf99496832fbc7d2881f41187124b113718 (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 ff62ffc93adaccbee6aed555ec2e83561d4da1fa
Merge: f03f1cf994 94cc593de8
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sun Aug 9 09:33:39 2026 -0700

    Merge pull request 'Fix memory leaks found by post-3.6 split audit' (!677) from Komzpa/postgis:fix/split-review-findings-20260809 into master
    
    Audit of master changes after the 3.6 branch split found two live SQL-callable memory leaks and one stale development-doc pointer.
    
    Changes:
    - Free the deserialized parent geometry in ST_GeometryN, including NULL-result paths.
    - Free both deserialized geometries in the ST_DWithin brute-force fallback.
    - Update Version.config to point at the flattened release-process.md document.
    - Add a 3.7.0beta2 NEWS entry.
    
    Validation:
    - git diff --check
    - ./autogen.sh && ./configure --without-raster --without-topology --without-protobuf --without-sfcgal
    - make -C postgis lwgeom_ogc.o lwgeom_geos_predicates.o
    - python3 -B utils/docs/tests/test_check_news.py
    - python3 -B utils/docs/tests/test_check_contributor_credits.py
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/677


commit 94cc593de819c917edc0d0a49c9c2ee76a5f88ce
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sun Aug 9 20:27:55 2026 +0400

    Fix memory leaks found by split review

diff --git a/NEWS b/NEWS
index 0991688ce2..f5a8cbbc25 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ These are only changes since 3.7.0beta1.
 
  - GT-675, Preserve TRIANGLE children while normalizing malformed TINs
           (Darafei Praliaskouski)
+ - GT-677, Fix memory leaks in ST_GeometryN and ST_DWithin
+          (Darafei Praliaskouski)
  - GT-671, Harden extension install and upgrade SQL against attacker-controlled
           object resolution in writable schemas
           (reported by Eric Ridge, PlanetScale;
diff --git a/Version.config b/Version.config
index 5576a8572d..2e5a68cb5e 100644
--- a/Version.config
+++ b/Version.config
@@ -1,7 +1,7 @@
 # Version numbering central repository, to be included from various
 # places during the build process
 
-# See doc/development/release-process/ for definitions of those three.
+# See doc/development/release-process.md for definitions of those three.
 
 POSTGIS_MAJOR_VERSION=3
 POSTGIS_MINOR_VERSION=7
diff --git a/postgis/lwgeom_geos_predicates.c b/postgis/lwgeom_geos_predicates.c
index 670410f4c5..e09b536688 100644
--- a/postgis/lwgeom_geos_predicates.c
+++ b/postgis/lwgeom_geos_predicates.c
@@ -1200,6 +1200,8 @@ Datum LWGEOM_dwithin(PG_FUNCTION_ARGS)
 		LWGEOM *lwgeom1 = lwgeom_from_gserialized(geom1);
 		LWGEOM *lwgeom2 = lwgeom_from_gserialized(geom2);
 		mindist = lwgeom_mindistance2d_tolerance(lwgeom1, lwgeom2, tolerance);
+		lwgeom_free(lwgeom1);
+		lwgeom_free(lwgeom2);
 		is_dwithin = (tolerance >= mindist);
 	}
 
diff --git a/postgis/lwgeom_ogc.c b/postgis/lwgeom_ogc.c
index 0270116d23..01d54f5f1c 100644
--- a/postgis/lwgeom_ogc.c
+++ b/postgis/lwgeom_ogc.c
@@ -438,7 +438,11 @@ Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
 	subgeom = lwgeom_extract_geometry_n(lwgeom, idx, false);
 
 	if (!subgeom)
+	{
+		lwgeom_free(lwgeom);
+		PG_FREE_IF_COPY(geom, 0);
 		PG_RETURN_NULL();
+	}
 
 	/* If not returning the original geometry */
 	if (subgeom != lwgeom)
@@ -448,6 +452,7 @@ Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
 		if (lwgeom->bbox) lwgeom_add_bbox(subgeom);
 	}
 	result = geometry_serialize(subgeom);
+	lwgeom_free(lwgeom);
 	PG_FREE_IF_COPY(geom, 0);
 	PG_RETURN_POINTER(result);
 }

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

Summary of changes:
 NEWS                             | 2 ++
 Version.config                   | 2 +-
 postgis/lwgeom_geos_predicates.c | 2 ++
 postgis/lwgeom_ogc.c             | 5 +++++
 4 files changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list