From 065e42c2be9ebebaff2b635f77b3fa658750a68e Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Sun, 9 Jul 2017 14:14:18 +0000 Subject: [PATCH] Memory leak in lwline_from_wkb_state References #3782 for PostGIS 2.4 (trunk) Patch provided by Even Rouault git-svn-id: http://svn.osgeo.org/postgis/trunk@15478 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwin_wkb.c | 3 +++ 1 file changed, 3 insertions(+) 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 ) { -- 2.40.0