2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

sigh. do not set the lock from node->locknum until being sure node is not null

This commit is contained in:
David Lawrence 2001-04-20 21:22:09 +00:00
parent f5c1382fdf
commit ed1c40264e

View File

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.158 2001/04/20 14:35:04 tale Exp $ */
/* $Id: rbtdb.c,v 1.159 2001/04/20 21:22:09 tale Exp $ */
/*
* Principal Author: Bob Halley
@ -4616,11 +4616,12 @@ static inline void
dereference_iter_node(rbtdb_dbiterator_t *rbtdbiter) {
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)rbtdbiter->common.db;
dns_rbtnode_t *node = rbtdbiter->node;
isc_mutex_t *lock = &rbtdb->node_locks[node->locknum].lock;
isc_mutex_t *lock;
if (node == NULL)
return;
lock = &rbtdb->node_locks[node->locknum].lock;
LOCK(lock);
INSIST(rbtdbiter->node->references > 0);
if (--node->references == 0)