[GRASS-SVN] r44962 - grass/trunk/lib/btree2

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 11 13:30:03 EST 2011


Author: mmetz
Date: 2011-01-11 10:30:03 -0800 (Tue, 11 Jan 2011)
New Revision: 44962

Modified:
   grass/trunk/lib/btree2/rbtree.c
Log:
reset pointers

Modified: grass/trunk/lib/btree2/rbtree.c
===================================================================
--- grass/trunk/lib/btree2/rbtree.c	2011-01-11 18:27:23 UTC (rev 44961)
+++ grass/trunk/lib/btree2/rbtree.c	2011-01-11 18:30:03 UTC (rev 44962)
@@ -220,6 +220,7 @@
 	f->data = q->data;
 	p->link[p->link[1] == q] = q->link[q->link[0] == NULL];
 	free(q);
+	q = NULL;
 	tree->count--;
 	removed = 1;
     }
@@ -422,7 +423,9 @@
 	    /* No left links, just kill the node and move on */
 	    save = it->link[1];
 	    free(it->data);
+	    it->data = NULL;
 	    free(it);
+	    it = NULL;
 	}
 	else {
 	    /* Rotate away the left link and check again */
@@ -432,6 +435,7 @@
 	}
     }
     free(tree);
+    tree = NULL;
 }
 
 /* used for debugging: check for errors in tree structure */



More information about the grass-commit mailing list