From fe1bcdeb287c8ec8ca2bfa51fe8b5548ada42324 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 22 May 2003 23:48:02 +0000 Subject: [PATCH] ITS#2540 not sure, difficult to reproduce crash... --- servers/slapd/back-bdb/cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 832e4931c4..e3630367c0 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -441,11 +441,6 @@ bdb_cache_find_parent( /* This node is not fully connected yet */ ein->bei_state = CACHE_ENTRY_NOT_LINKED; - /* If this is the first time, save this node - * to be returned later. - */ - if ( eir == NULL ) eir = ein; - /* Insert this node into the ID tree */ ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock ); if ( avl_insert( &bdb->bi_cache.c_idtree, (caddr_t)ein, @@ -461,6 +456,11 @@ bdb_cache_find_parent( bdb_cache_entryinfo_unlock( ein ); } + /* If this is the first time, save this node + * to be returned later. + */ + if ( eir == NULL ) eir = ein; + /* If there was a previous node, link it to this one */ if ( ei2 ) ei2->bei_parent = ein; -- 2.39.2