From: Sandro Santilli Date: Wed, 19 Dec 2012 20:52:22 +0000 (+0000) Subject: Fix memory leak in circ_tree_new X-Git-Tag: 2.1.0beta2~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8845553fa73b4b2c82bbfc861d7a76c6067ead72;p=postgis Fix memory leak in circ_tree_new git-svn-id: http://svn.osgeo.org/postgis/trunk@10865 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwgeodetic_tree.c b/liblwgeom/lwgeodetic_tree.c index 3b72435eb..02f000288 100644 --- a/liblwgeom/lwgeodetic_tree.c +++ b/liblwgeom/lwgeodetic_tree.c @@ -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);