[postgis-tickets] r17906 - Memory leak in lwpoly_from_wkb_state

Raul raul at rmr.ninja
Fri Oct 11 06:24:04 PDT 2019


Author: algunenano
Date: 2019-10-11 06:24:03 -0700 (Fri, 11 Oct 2019)
New Revision: 17906

Modified:
   trunk/liblwgeom/lwin_wkb.c
Log:
Memory leak in lwpoly_from_wkb_state

References #4535



Modified: trunk/liblwgeom/lwin_wkb.c
===================================================================
--- trunk/liblwgeom/lwin_wkb.c	2019-10-10 17:28:14 UTC (rev 17905)
+++ trunk/liblwgeom/lwin_wkb.c	2019-10-11 13:24:03 UTC (rev 17906)
@@ -540,7 +540,10 @@
 	{
 		POINTARRAY *pa = ptarray_from_wkb_state(s);
 		if (pa == NULL)
+		{
+			lwpoly_free(poly);
 			return NULL;
+		}
 
 		/* Check for at least four points. */
 		if (s->check & LW_PARSER_CHECK_MINPOINTS && pa->npoints < 4)



More information about the postgis-tickets mailing list