summaryrefslogtreecommitdiff
path: root/lib/dns/rbt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns/rbt.c')
-rw-r--r--lib/dns/rbt.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
index e6fc6328..b045cea1 100644
--- a/lib/dns/rbt.c
+++ b/lib/dns/rbt.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbt.c,v 1.138.36.2 2008/01/22 23:27:35 tbox Exp $ */
+/* $Id: rbt.c,v 1.138.36.3 2008/03/31 13:18:00 fdupont Exp $ */
/*! \file */
@@ -2056,10 +2056,6 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
node = LEFT(node);
goto traverse;
}
- if (RIGHT(node) != NULL) {
- node = RIGHT(node);
- goto traverse;
- }
if (DOWN(node) != NULL) {
node = DOWN(node);
goto traverse;
@@ -2076,14 +2072,15 @@ dns_rbt_deletetreeflat(dns_rbt_t *rbt, unsigned int quantum,
node->magic = 0;
#endif
parent = PARENT(node);
+ if (RIGHT(node) != NULL)
+ PARENT(RIGHT(node)) = parent;
if (parent != NULL) {
if (LEFT(parent) == node)
- LEFT(parent) = NULL;
+ LEFT(parent) = RIGHT(node);
else if (DOWN(parent) == node)
- DOWN(parent) = NULL;
- else if (RIGHT(parent) == node)
- RIGHT(parent) = NULL;
- }
+ DOWN(parent) = RIGHT(node);
+ } else
+ parent = RIGHT(node);
isc_mem_put(rbt->mctx, node, NODE_SIZE(node));
rbt->nodecount--;