From ed1c40264e6303a3b36cd70dfbe116143c5a0431 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 20 Apr 2001 21:22:09 +0000 Subject: [PATCH] sigh. do not set the lock from node->locknum until being sure node is not null --- lib/dns/rbtdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index f9e3910734..275bcadcec 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -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)