]> granicus.if.org Git - postgis/commitdiff
Fix leaks in lwcurvepoly_segmentize and its tester
authorSandro Santilli <strk@keybit.net>
Wed, 1 Oct 2014 14:07:12 +0000 (14:07 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 1 Oct 2014 14:07:12 +0000 (14:07 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13023 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_force_sfs.c
liblwgeom/lwsegmentize.c

index 608b65b6813a7a17f4e08211ada8c46301d436ad..4815d0992355e7c8f34743b758bb1e83adc9f815 100644 (file)
@@ -46,6 +46,7 @@ static void do_type_test(char * in, int type)
                        in, lwtype_name(h->type), lwtype_name(type));
        CU_ASSERT_EQUAL(h->type, type);
        lwgeom_free(h);
+       lwgeom_free(g);
 }
 
 
index f5c32ebe447c6efc336cfcbf6b53ba02ec97b8b1..a7eb66fb299891bef9127370887b4387937cc31b 100644 (file)
@@ -306,7 +306,7 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
                {
                        line = lwcircstring_segmentize((LWCIRCSTRING *)tmp, perQuad);
                        ptarray[i] = ptarray_clone_deep(line->points);
-                       lwfree(line);
+                       lwline_free(line);
                }
                else if (tmp->type == LINETYPE)
                {
@@ -317,7 +317,7 @@ lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
                {
                        line = lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
                        ptarray[i] = ptarray_clone_deep(line->points);
-                       lwfree(line);
+                       lwline_free(line);
                }
                else
                {
@@ -774,7 +774,7 @@ lwpolygon_desegmentize(LWPOLY *poly)
        {
                for (i=0; i<poly->nrings; i++)
                {
-                       lwfree(geoms[i]);
+                       lwfree(geoms[i]); /* TODO: should this be lwgeom_free instead ? */
                }
                return lwgeom_clone((LWGEOM *)poly);
        }
@@ -803,7 +803,7 @@ lwmline_desegmentize(LWMLINE *mline)
        {
                for (i=0; i<mline->ngeoms; i++)
                {
-                       lwfree(geoms[i]);
+                       lwfree(geoms[i]); /* TODO: should this be lwgeom_free instead ? */
                }
                return lwgeom_clone((LWGEOM *)mline);
        }
@@ -831,7 +831,7 @@ lwmpolygon_desegmentize(LWMPOLY *mpoly)
        {
                for (i=0; i<mpoly->ngeoms; i++)
                {
-                       lwfree(geoms[i]);
+                       lwfree(geoms[i]); /* TODO: should this be lwgeom_free instead ? */
                }
                return lwgeom_clone((LWGEOM *)mpoly);
        }