Commit 118ceb3b authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2090] Fix the segfault

There was confusion about left_ and right_. After all, the left and
right depends on your point of view and on how many mirrors there are
around.
parent b2395c85
......@@ -1410,7 +1410,7 @@ RBTree<T>::insert(const isc::dns::Name& target_name, RBNode<T>** new_node) {
}
typename RBNode<T>::RBNodePtr* current_root = (up_node != NULLNODE) ?
&up_node->down_ : &root_;
&(up_node->down_) : &root_;
// using auto_ptr here is avoid memory leak in case of exceptoin raised
// after the RBNode creation, if we can make sure no exception will be
// raised until the end of the function, we can remove it for optimization
......@@ -1548,7 +1548,7 @@ RBTree<T>::rightRotate(typename RBNode<T>::RBNodePtr* root, RBNode<T>* node) {
if (node->parent_ != NULLNODE) {
if (node == node->getParent()->getRight()) {
node->getParent()->left_ = left;
node->getParent()->right_ = left;
} else {
node->getParent()->left_ = left;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment