From: Paul Ramsey Date: Tue, 23 Apr 2013 21:03:35 +0000 (+0000) Subject: #2277, potential segfault condition removed X-Git-Tag: 2.1.0beta2~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=692b242fdf4e941b65492cbd8f545835f61e92aa;p=postgis #2277, potential segfault condition removed git-svn-id: http://svn.osgeo.org/postgis/trunk@11315 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_geos_prepared.c b/postgis/lwgeom_geos_prepared.c index 2913613dc..207a5ebb7 100644 --- a/postgis/lwgeom_geos_prepared.c +++ b/postgis/lwgeom_geos_prepared.c @@ -259,11 +259,13 @@ DeletePrepGeomHashEntry(MemoryContext mcxt) /* Delete the projection object from the hash */ he = (PrepGeomHashEntry *) hash_search(PrepGeomHash, key, HASH_REMOVE, NULL); - he->prepared_geom = NULL; - he->geom = NULL; - if (!he) + { elog(ERROR, "DeletePrepGeomHashEntry: There was an error removing the geometry object from this MemoryContext (%p)", (void *)mcxt); + } + + he->prepared_geom = NULL; + he->geom = NULL; } /**