From: Howard Chu Date: Sun, 19 Oct 2003 09:55:31 +0000 (+0000) Subject: ITS#2780, redundant cache add X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~538 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=56498a59ddce902c3d594b9b7d4db04464f8bd7b;p=openldap ITS#2780, redundant cache add --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index f18e21ce20..234f2cf85d 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -744,6 +744,8 @@ bdb_cache_add( if ( eip->bei_dkids ) eip->bei_dkids++; #endif rc = bdb_entryinfo_add_internal( bdb, &ei, &new ); + /* bdb_csn_commit can cause this when adding the database root entry */ + if ( new->bei_e ) bdb_entry_return( new->bei_e ); new->bei_e = e; e->e_private = new; new->bei_state = CACHE_ENTRY_NO_KIDS | CACHE_ENTRY_NO_GRANDKIDS;