From: Paul Ramsey Date: Tue, 17 Mar 2015 16:30:33 +0000 (+0000) Subject: #2969, memory leak in the function of "lwtriangle_from_wkb_state" X-Git-Tag: 2.2.0rc1~584 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92be63975a80e9e725e8070de986241814a50604;p=postgis #2969, memory leak in the function of "lwtriangle_from_wkb_state" git-svn-id: http://svn.osgeo.org/postgis/trunk@13353 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwin_wkb.c b/liblwgeom/lwin_wkb.c index cfd887f03..5a90520d6 100644 --- a/liblwgeom/lwin_wkb.c +++ b/liblwgeom/lwin_wkb.c @@ -557,6 +557,10 @@ static LWTRIANGLE* lwtriangle_from_wkb_state(wkb_parse_state *s) return NULL; } + /* Empty TRIANGLE starts w/ empty POINTARRAY, free it first */ + if (tri->points) + ptarray_free(tri->points); + tri->points = pa; return tri; }