]> git.sur5r.net Git - openldap/commitdiff
don't call cache_return_entry_rw with e of NULL
authorKurt Zeilenga <kurt@openldap.org>
Fri, 31 Mar 2006 21:03:51 +0000 (21:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 31 Mar 2006 21:03:51 +0000 (21:03 +0000)
servers/slapd/back-ldbm/modify.c

index 9625682841c9decf629faa986a2ca0896b1ed036..18557bf6245954658052d001d3d1b0b92d6168b0 100644 (file)
@@ -259,7 +259,7 @@ ldbm_back_modify(
                        cache_return_entry_r( &li->li_cache, matched );
                } else {
                        rs->sr_ref = referral_rewrite( default_referral, NULL,
-                                               &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+                               &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
                rs->sr_err = LDAP_REFERRAL;
@@ -267,8 +267,7 @@ ldbm_back_modify(
                goto return_results;
        }
 
-       if ( !manageDSAit && is_entry_referral( e ) )
-       {
+       if ( !manageDSAit && is_entry_referral( e ) ) {
                /* parent is a referral, don't allow add */
                /* parent is an alias, don't allow add */
                rs->sr_ref = get_entry_referrals( op, e );
@@ -295,7 +294,7 @@ ldbm_back_modify(
        }
 
 return_results:;
-       cache_return_entry_w( &li->li_cache, e );
+       if( e != NULL ) cache_return_entry_w( &li->li_cache, e );
        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
        send_ldap_result( op, rs );