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

liblwgeom/lwlinearreferencing.c

index a3dbe068d4471fc463e40c374b6b89df3f47e15f..3ff32246df06c309dd3cf705afd86dceeacb68bc 100644 (file)
@@ -1134,16 +1134,19 @@ lwgeom_tcpa(const LWGEOM *g1, const LWGEOM *g2, double *mindist)
     {
       if ( -1 == ptarray_locate_along_linear(l1->points, t0, &p0, 0) )
       {
+        lwfree(mvals);
         lwerror("Could not find point with M=%g on first geom", t0);
         return -1;
       }
       if ( -1 == ptarray_locate_along_linear(l2->points, t0, &p1, 0) )
       {
+        lwfree(mvals);
         lwerror("Could not find point with M=%g on second geom", t0);
         return -1;
       }
       *mindist = distance3d_pt_pt((POINT3D*)&p0, (POINT3D*)&p1);
     }
+    lwfree(mvals);
     return t0;
   }}