]> granicus.if.org Git - postgis/commitdiff
#2277, potential segfault condition removed
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 23 Apr 2013 21:03:35 +0000 (21:03 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 23 Apr 2013 21:03:35 +0000 (21:03 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11315 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_geos_prepared.c

index 2913613dcc8617bfb4ad39190ca5067442a80db9..207a5ebb72bf6af503d3b1a13bd998e56ed9ad47 100644 (file)
@@ -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;
 }
 
 /**