[postgis-tickets] r15479 - Memory leak in lwline_from_wkb_state

Regina Obe lr at pcorp.us
Sun Jul 9 07:35:20 PDT 2017


Author: robe
Date: 2017-07-09 07:35:20 -0700 (Sun, 09 Jul 2017)
New Revision: 15479

Modified:
   branches/2.3/NEWS
   branches/2.3/liblwgeom/lwin_wkb.c
Log:
Memory leak in lwline_from_wkb_state
Closes #3782 for PostGIS 2.3.4 
Patch provided by Even Rouault

Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS	2017-07-09 14:14:18 UTC (rev 15478)
+++ branches/2.3/NEWS	2017-07-09 14:35:20 UTC (rev 15479)
@@ -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
 

Modified: branches/2.3/liblwgeom/lwin_wkb.c
===================================================================
--- branches/2.3/liblwgeom/lwin_wkb.c	2017-07-09 14:14:18 UTC (rev 15478)
+++ branches/2.3/liblwgeom/lwin_wkb.c	2017-07-09 14:35:20 UTC (rev 15479)
@@ -441,7 +441,10 @@
 	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 )
 	{



More information about the postgis-tickets mailing list