]> granicus.if.org Git - postgis/commitdiff
Fix memory leak in circ_tree_new
authorSandro Santilli <strk@keybit.net>
Wed, 19 Dec 2012 20:52:22 +0000 (20:52 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 19 Dec 2012 20:52:22 +0000 (20:52 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10865 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeodetic_tree.c

index 3b72435ebfa3dd70f6aa82dd279a6e4211e2fde5..02f00028842974dfd7936e439c477e50e06a61df 100644 (file)
@@ -317,8 +317,10 @@ circ_tree_new(const POINTARRAY* pa)
        }
        
        /* Special case: only zero-length edges. Make a point node. */
-       if ( j == 0 )
+       if ( j == 0 ) {
+               lwfree(nodes);
                return circ_node_leaf_point_new(pa);
+       }
 
        /* Merge the node list pairwise up into a tree */
        tree = circ_nodes_merge(nodes, j);