rb_tree: fix possible access-after-free-error in trbt_traversearray32_node
commit3dab0c9b0ba7ce6f15c9a9c3fb45188edf8ce307
authorMichael Adam <obnox@samba.org>
Thu, 22 Dec 2011 17:09:36 +0000 (22 18:09 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 23 Dec 2011 16:39:00 +0000 (23 17:39 +0100)
treee86ce508ca19dbb939d11da6e01926e762c5f1e4
parent6e42e03b57769c0cc6ce7cc723af93d5a6372918
rb_tree: fix possible access-after-free-error in trbt_traversearray32_node

When the traverse callback frees the current node, the traverse of the
rbtree can fail (the next node->right fails since node is not there any more...).
This is fixed by introducing variables to store the right (and left)
pointers before the callback is called.

(This used to be ctdb commit 8b0caaeed154d26c67a73659d3bbbdd63b21be11)
ctdb/common/rb_tree.c