diff --git a/src/core/pal/layer.cpp b/src/core/pal/layer.cpp index 0bba17a..02e5dc0 100644 --- a/src/core/pal/layer.cpp +++ b/src/core/pal/layer.cpp @@ -262,6 +262,11 @@ namespace pal // break the (possibly multi-part) geometry into simple geometries LinkedList *simpleGeometries = unmulti( the_geom ); + if ( simpleGeometries == NULL ) // unmulti() failed? + { + modMutex->unlock(); + throw InternalException::UnknownGeometry(); + } while ( simpleGeometries->size() > 0 ) { @@ -277,7 +282,10 @@ namespace pal int type = GEOSGeomTypeId( geom ); if ( type != GEOS_POINT && type != GEOS_LINESTRING && type != GEOS_POLYGON ) + { + modMutex->unlock(); throw InternalException::UnknownGeometry(); + } FeaturePart* fpart = new FeaturePart( f, geom ); diff --git a/src/core/pal/util.cpp b/src/core/pal/util.cpp index 65ab0a5..5942563 100644 --- a/src/core/pal/util.cpp +++ b/src/core/pal/util.cpp @@ -231,7 +231,8 @@ namespace pal final_queue->push_back( geom ); break; default: - throw InternalException::UnknownGeometry(); + delete final_queue; + final_queue = NULL; } } delete queue;