[SCM] PostGIS branch master updated. 3.5.0-48-g75d9b03d6

git at osgeo.org git at osgeo.org
Thu Nov 7 14:34:15 PST 2024


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  75d9b03d6c4ec5d47637f9912081f4eaf332810e (commit)
      from  e479451016affe87eec1b6033184246a61d18276 (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 75d9b03d6c4ec5d47637f9912081f4eaf332810e
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Nov 7 22:22:08 2024 +0100

    Explicitly release state of topology set-returning functions
    
    References #5808

diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c
index 188b052dc..e29f7713b 100644
--- a/topology/postgis_topology.c
+++ b/topology/postgis_topology.c
@@ -4226,6 +4226,8 @@ Datum ST_GetFaceEdges(PG_FUNCTION_ARGS)
 
   if ( state->curr == state->nelems )
   {
+    if ( state->nelems ) lwfree(state->elems);
+    lwfree( state );
     SRF_RETURN_DONE(funcctx);
   }
 
@@ -5108,6 +5110,7 @@ Datum TopoGeo_AddLinestring(PG_FUNCTION_ARGS)
     tol = PG_GETARG_FLOAT8(2);
     if ( tol < 0 )
     {
+      lwgeom_free(lwgeom);
       PG_FREE_IF_COPY(geom, 1);
       lwpgerror("Tolerance must be >=0");
       PG_RETURN_NULL();
@@ -5115,6 +5118,8 @@ Datum TopoGeo_AddLinestring(PG_FUNCTION_ARGS)
 
     if ( SPI_OK_CONNECT != SPI_connect() )
     {
+      lwgeom_free(lwgeom);
+      PG_FREE_IF_COPY(geom, 1);
       lwpgerror("Could not connect to SPI");
       PG_RETURN_NULL();
     }
@@ -5172,6 +5177,9 @@ Datum TopoGeo_AddLinestring(PG_FUNCTION_ARGS)
   if ( state->curr == state->nelems )
   {
     POSTGIS_DEBUG(1, "We're done, cleaning up all");
+
+    if ( state->nelems ) lwfree(state->elems);
+    lwfree( state );
     SRF_RETURN_DONE(funcctx);
   }
 
@@ -5377,6 +5385,8 @@ Datum TopoGeo_AddPolygon(PG_FUNCTION_ARGS)
   if ( state->curr == state->nelems )
   {
     POSTGIS_DEBUG(1, "We're done, cleaning up all");
+    if ( state->nelems ) lwfree(state->elems);
+    lwfree( state );
     SRF_RETURN_DONE(funcctx);
   }
 
@@ -5500,6 +5510,8 @@ Datum GetRingEdges(PG_FUNCTION_ARGS)
   if ( state->curr == state->nelems )
   {
     POSTGIS_DEBUG(1, "We're done, cleaning up all");
+    if ( state->nelems ) lwfree(state->elems);
+    lwfree( state );
     SRF_RETURN_DONE(funcctx);
   }
 

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

Summary of changes:
 topology/postgis_topology.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list