Browse Source

[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.
Michal 'vorner' Vaner 12 years ago
parent
commit
118ceb3b22
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/lib/datasrc/rbtree.h

+ 2 - 2
src/lib/datasrc/rbtree.h

@@ -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;
         }