From eeec949f3ae2248e21f222ef334b4c32a2199362 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Mon, 11 Sep 2017 18:45:31 +0000 Subject: [PATCH] Try and ensure clean memory into kmeans algorithm git-svn-id: http://svn.osgeo.org/postgis/trunk@15692 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/lwkmeans.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/liblwgeom/lwkmeans.c b/liblwgeom/lwkmeans.c index 7500c9464..1a37123b7 100644 --- a/liblwgeom/lwkmeans.c +++ b/liblwgeom/lwkmeans.c @@ -93,6 +93,10 @@ lwgeom_cluster_2d_kmeans(const LWGEOM **geoms, int ngeoms, int k) assert(ngeoms>0); assert(geoms); + /* Initialize our static structs */ + memset(&config, 0, sizeof(kmeans_config)); + memset(&result, 0, sizeof(kmeans_result)); + if (ngeoms