From: Hallvard Furuseth Date: Mon, 5 Apr 1999 18:00:57 +0000 (+0000) Subject: Delay free(e.e_ndn) in bdb2i_cache_find_entry_dn2id() to after "goto try_again" X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~248 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2b2c154ae628cc6a98f21ccb17fa8f86b3b2e960;p=openldap Delay free(e.e_ndn) in bdb2i_cache_find_entry_dn2id() to after "goto try_again" --- diff --git a/servers/slapd/back-bdb2/cache.c b/servers/slapd/back-bdb2/cache.c index f37b870234..0e8f826c5a 100644 --- a/servers/slapd/back-bdb2/cache.c +++ b/servers/slapd/back-bdb2/cache.c @@ -377,7 +377,6 @@ try_again: * we do not need to lock the entry if we only * check the state, refcnt, LRU, and id. */ - free(e.e_ndn); #ifdef LDAP_DEBUG assert( ep->e_private ); @@ -410,11 +409,8 @@ try_again: /* save id */ id = ep->e_id; - - /* free cache mutex */ - ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); - - return( id ); + } else { + id = NOID; } free(e.e_ndn); @@ -422,7 +418,7 @@ try_again: /* free cache mutex */ ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); - return( NOID ); + return( id ); } /*