]> granicus.if.org Git - postgis/commitdiff
Fix crash caused by double-free in LWGEOM_same - we were accidentally freeing the...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Fri, 28 Mar 2008 18:55:17 +0000 (18:55 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Fri, 28 Mar 2008 18:55:17 +0000 (18:55 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2742 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_functions_basic.c

index 85f43e854f344f7cc37ea329427e1cf64b50b32a..0f1f5d566e2cc343fe2a7bbe5eba910283dfb67d 100644 (file)
@@ -2767,14 +2767,14 @@ Datum LWGEOM_same(PG_FUNCTION_ARGS)
        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 */
        }