We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15d9366 commit a5af7f7Copy full SHA for a5af7f7
1 file changed
mapgeos.c
@@ -943,6 +943,7 @@ pointObj *msGEOSGetCentroid(shapeObj *shape)
943
if(!g1) return NULL;
944
945
g2 = GEOSGetCentroid_r(handle,g1);
946
+ if (!g2) return NULL;
947
948
point = (pointObj *) malloc(sizeof(pointObj));
949
@@ -952,7 +953,7 @@ pointObj *msGEOSGetCentroid(shapeObj *shape)
952
953
GEOSCoordSeq_getY_r(handle,coords, 0, &(point->y));
954
/* GEOSCoordSeq_getZ(coords, 0, &(point->z)); */
955
- GEOSCoordSeq_destroy_r(handle,coords);
956
+ GEOSGeom_destroy_r(handle, g2);
957
958
return point;
959
#else
0 commit comments