[postgis-commits] svn - r2742 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Fri Mar 28 11:55:18 PDT 2008


Author: mcayland
Date: 2008-03-28 11:55:17 -0700 (Fri, 28 Mar 2008)
New Revision: 2742

Modified:
   trunk/lwgeom/lwgeom_functions_basic.c
Log:
Fix crash caused by double-free in LWGEOM_same - we were accidentally freeing the 1st parameter twice instead of freeing the second parameter. Thanks to Cliff Wright for the bug report.

Modified: trunk/lwgeom/lwgeom_functions_basic.c
===================================================================
--- trunk/lwgeom/lwgeom_functions_basic.c	2008-03-28 17:05:04 UTC (rev 2741)
+++ trunk/lwgeom/lwgeom_functions_basic.c	2008-03-28 18:55:17 UTC (rev 2742)
@@ -2767,14 +2767,14 @@
 	if ( TYPE_GETTYPE(g1->type) != TYPE_GETTYPE(g2->type) )
 	{
 		PG_FREE_IF_COPY(g1, 0);
-		PG_FREE_IF_COPY(g2, 0);
+		PG_FREE_IF_COPY(g2, 1);
 		PG_RETURN_BOOL(FALSE); /* different types */
 	}
 
 	if ( TYPE_GETZM(g1->type) != TYPE_GETZM(g2->type) )
 	{
 		PG_FREE_IF_COPY(g1, 0);
-		PG_FREE_IF_COPY(g2, 0);
+		PG_FREE_IF_COPY(g2, 1);
 		PG_RETURN_BOOL(FALSE); /* different dimensions */
 	}
 



More information about the postgis-commits mailing list