projects
/
oweals
/
tinc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix issues found by Coverity.
[oweals/tinc.git]
/
src
/
avl_tree.c
diff --git
a/src/avl_tree.c
b/src/avl_tree.c
index a8bf5d5f733c99863c31cdcd9e19bdf86a0c8fca..4b237560423f379b72507960eed1bb7ccef50628 100644
(file)
--- a/
src/avl_tree.c
+++ b/
src/avl_tree.c
@@
-228,8
+228,7
@@
static void avl_rebalance(avl_tree_t *tree, avl_node_t *node)
gchild->left->parent = gchild;
gchild->right = child;
gchild->left->parent = gchild;
gchild->right = child;
- if(gchild->right)
- gchild->right->parent = gchild;
+ gchild->right->parent = gchild;
*superparent = gchild;
gchild->parent = parent;
*superparent = gchild;
gchild->parent = parent;
@@
-600,6
+599,8
@@
void avl_unlink_node(avl_tree_t *tree, avl_node_t *node)
balnode = parent;
} else {
subst = node->prev;
balnode = parent;
} else {
subst = node->prev;
+ if(!subst) // This only happens if node is not actually in a tree at all.
+ abort();
if(subst == left) {
balnode = subst;
if(subst == left) {
balnode = subst;