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

index 6fb33306b6a00f7ce26a60c1e54d97ff799b000f..5386735fcc12d0f8eb86ee089b1be3a636393122 100644 (file)
@@ -445,7 +445,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 );
@@ -477,11 +476,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);
@@ -489,7 +485,7 @@ try_again:
        /* free cache mutex */
        ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
 
-       return( NOID );
+       return( id );
 }
 
 /*