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.
This commit is contained in:
@@ -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--;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user