]> git.sur5r.net Git - openldap/commitdiff
Delay free(e.e_ndn) in bdb2i_cache_find_entry_dn2id() to after "goto try_again"
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 5 Apr 1999 18:00:57 +0000 (18:00 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 5 Apr 1999 18:00:57 +0000 (18:00 +0000)
servers/slapd/back-bdb2/cache.c

index f37b870234d80abcc2a0ccb40573ceb39829c940..0e8f826c5ac8965a9a5a67d9b032e46768f3950f 100644 (file)
@@ -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 );
 }
 
 /*