[postgis-tickets] r17403 - Reallocate Union state in aggregate context.

Darafei komzpa at gmail.com
Sun Apr 21 05:58:43 PDT 2019


Author: komzpa
Date: 2019-04-21 05:58:43 -0700 (Sun, 21 Apr 2019)
New Revision: 17403

Modified:
   trunk/postgis/lwgeom_geos.c
Log:
Reallocate Union state in aggregate context.

References #4382


Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2019-04-21 10:19:24 UTC (rev 17402)
+++ trunk/postgis/lwgeom_geos.c	2019-04-21 12:58:43 UTC (rev 17403)
@@ -593,7 +593,9 @@
 			if (state->ngeoms > state->alen)
 			{
 				state->alen *= 2;
+				MemoryContext old = MemoryContextSwitchTo(aggcontext);
 				state->geoms = repalloc(state->geoms, state->alen);
+				MemoryContextSwitchTo(old);
 			}
 
 			state->geoms[curgeom] = g;



More information about the postgis-tickets mailing list