]> granicus.if.org Git - postgis/commitdiff
Remove memory leak
authorPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 29 Jun 2015 17:00:47 +0000 (17:00 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Mon, 29 Jun 2015 17:00:47 +0000 (17:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13745 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/cunit/cu_ptarray.c

index 4f5673032a9b528ed52474760a0fa51294b995d2..46e8022deb0eceb2624c917707f7ea6104acfb37 100644 (file)
@@ -698,30 +698,40 @@ static void test_ptarray_scale()
   wkt = "LINESTRING ZM (0 1 2 3,1 2 3 0,-2 -3 0 -1,-3 0 -1 -2)";
   line = lwgeom_as_lwline(lwgeom_from_text(wkt));
   pa = line->points;
+
   factor.x = factor.y = factor.z = factor.m = 1;
   ptarray_scale(pa, &factor);
   wktout = lwgeom_to_text(lwline_as_lwgeom(line));
   ASSERT_STRING_EQUAL(wktout, wkt);
+  lwfree(wktout);
+  
   factor.x = 2;
   wkt = "LINESTRING ZM (0 1 2 3,2 2 3 0,-4 -3 0 -1,-6 0 -1 -2)";
   ptarray_scale(pa, &factor);
   wktout = lwgeom_to_text(lwline_as_lwgeom(line));
   ASSERT_STRING_EQUAL(wktout, wkt);
+  lwfree(wktout);
+  
   factor.x = 1; factor.y = 3;
   wkt = "LINESTRING ZM (0 3 2 3,2 6 3 0,-4 -9 0 -1,-6 0 -1 -2)";
   ptarray_scale(pa, &factor);
   wktout = lwgeom_to_text(lwline_as_lwgeom(line));
   ASSERT_STRING_EQUAL(wktout, wkt);
+  lwfree(wktout);
+  
   factor.x = 1; factor.y = 1; factor.z = -2;
   wkt = "LINESTRING ZM (0 3 -4 3,2 6 -6 0,-4 -9 -0 -1,-6 0 2 -2)";
   ptarray_scale(pa, &factor);
   wktout = lwgeom_to_text(lwline_as_lwgeom(line));
   ASSERT_STRING_EQUAL(wktout, wkt);
+  lwfree(wktout);
+  
   factor.x = 1; factor.y = 1; factor.z = 1; factor.m = 2;
   wkt = "LINESTRING ZM (0 3 -4 6,2 6 -6 0,-4 -9 -0 -2,-6 0 2 -4)";
   ptarray_scale(pa, &factor);
   wktout = lwgeom_to_text(lwline_as_lwgeom(line));
   ASSERT_STRING_EQUAL(wktout, wkt);
+  lwfree(wktout);
 
   lwline_free(line);
 }