[postgis-tickets] r15478 - Memory leak in lwline_from_wkb_state

Regina Obe lr at pcorp.us
Sun Jul 9 07:14:18 PDT 2017


Author: robe
Date: 2017-07-09 07:14:18 -0700 (Sun, 09 Jul 2017)
New Revision: 15478

Modified:
   trunk/liblwgeom/lwin_wkb.c
Log:
Memory leak in lwline_from_wkb_state
References #3782 for PostGIS 2.4 (trunk)
Patch provided by Even Rouault

Modified: trunk/liblwgeom/lwin_wkb.c
===================================================================
--- trunk/liblwgeom/lwin_wkb.c	2017-07-06 20:41:38 UTC (rev 15477)
+++ trunk/liblwgeom/lwin_wkb.c	2017-07-09 14:14:18 UTC (rev 15478)
@@ -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