From: Regina Obe Date: Sun, 9 Jul 2017 14:35:20 +0000 (+0000) Subject: Memory leak in lwline_from_wkb_state X-Git-Tag: 2.3.4~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37b69b74d089cf15ca97ffc9c8fb0a9eec55a6d4;p=postgis Memory leak in lwline_from_wkb_state Closes #3782 for PostGIS 2.3.4 Patch provided by Even Rouault git-svn-id: http://svn.osgeo.org/postgis/branches/2.3@15479 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index d4603086a..f574a38e4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +PostGIS 2.3.4 +2017/xx/xx + + * Bug Fixes + + - #3782, Memory leak in lwline_from_wkb_state + (Even Rouault) + + + + PostGIS 2.3.3 2017/07/01 diff --git a/liblwgeom/lwin_wkb.c b/liblwgeom/lwin_wkb.c index 35539dc8e..4cac75357 100644 --- a/liblwgeom/lwin_wkb.c +++ b/liblwgeom/lwin_wkb.c @@ -441,7 +441,10 @@ static LWLINE* lwline_from_wkb_state(wkb_parse_state *s) POINTARRAY *pa = ptarray_from_wkb_state(s); if( pa == NULL || pa->npoints == 0 ) + { + ptarray_free(pa); return lwline_construct_empty(s->srid, s->has_z, s->has_m); + } if( s->check & LW_PARSER_CHECK_MINPOINTS && pa->npoints < 2 ) {