From: Howard Chu Date: Fri, 23 May 2003 01:12:50 +0000 (+0000) Subject: Don't avl_insert NULL kids X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~70 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f3e0a28f18133100d0294db6dda4de1ea2539939;p=openldap Don't avl_insert NULL kids --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index e3630367c0..7b78809cdc 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -450,10 +450,12 @@ bdb_cache_find_parent( bdb_cache_entryinfo_destroy( ein ); ein = (EntryInfo *)avl_find( bdb->bi_cache.c_idtree, (caddr_t) &ei, bdb_id_cmp ); - bdb_cache_entryinfo_lock( ein ); - avl_insert( &ein->bei_kids, (caddr_t)ei2, bdb_rdn_cmp, - avl_dup_error ); - bdb_cache_entryinfo_unlock( ein ); + if ( ei2 ) { + bdb_cache_entryinfo_lock( ein ); + avl_insert( &ein->bei_kids, (caddr_t)ei2, + bdb_rdn_cmp, avl_dup_error ); + bdb_cache_entryinfo_unlock( ein ); + } } /* If this is the first time, save this node