mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-09 01:30:39 -04:00
Move isc_mem_put to after node is checked for equality
isc_mem_put NULL's the pointer to the memory being freed. The
equality test 'parent->r == node' was accidentally being turned
into a test against NULL.
(cherry picked from commit ac2e0bc3ff)
This commit is contained in:
parent
9a1d565f07
commit
27eb8ed20f
1 changed files with 3 additions and 3 deletions
|
|
@ -694,13 +694,13 @@ isc_radix_remove(isc_radix_tree_t *radix, isc_radix_node_t *node) {
|
|||
return;
|
||||
}
|
||||
|
||||
isc_mem_put(radix->mctx, node, sizeof(*node));
|
||||
radix->num_active_node--;
|
||||
|
||||
if (parent->r == node) {
|
||||
parent->r = child;
|
||||
} else {
|
||||
INSIST(parent->l == node);
|
||||
parent->l = child;
|
||||
}
|
||||
|
||||
isc_mem_put(radix->mctx, node, sizeof(*node));
|
||||
radix->num_active_node--;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue