]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
fix opinfo
authorHoward Chu <hyc@openldap.org>
Fri, 26 Aug 2011 08:24:06 +0000 (01:24 -0700)
committerHoward Chu <hyc@openldap.org>
Fri, 26 Aug 2011 08:27:32 +0000 (01:27 -0700)
servers/slapd/back-mdb/bind.c
servers/slapd/back-mdb/compare.c
servers/slapd/back-mdb/operational.c
servers/slapd/back-mdb/referral.c
servers/slapd/back-mdb/search.c

index 95f017fc232ea6a817a798268f5389ac772a8478..fe34954632958f9e93ba454af38502c71128748a 100644 (file)
@@ -135,15 +135,9 @@ mdb_bind( Operation *op, SlapReply *rs )
        }
 
 done:
-       moi->moi_ref--;
-       if ( moi->moi_ref < 1 ) {
-               if ( moi->moi_flag & MOI_READER ) {
-                       mdb_txn_reset( moi->moi_txn );
-               }       /* writers can abort themselves */
+       if ( moi == &opinfo ) {
+               mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
-               if ( moi->moi_flag & MOI_FREEIT ) {
-                       op->o_tmpfree( moi, op->o_tmpmemctx );
-               }
        }
        /* free entry and reader lock */
        if( e != NULL ) {
index 2b2ddfb981c21339d1e5269aa14f83fd5b7f05d9..89ca4d4f31ffaa93326ae5e4703d18c0dd9a7a82 100644 (file)
@@ -123,15 +123,9 @@ return_results:
        }
 
 done:
-       moi->moi_ref--;
-       if ( moi->moi_ref < 1 ) {
-               if ( moi->moi_flag & MOI_READER ) {
-                       mdb_txn_reset( moi->moi_txn );
-               }       /* writers can abort themselves */
+       if ( moi == &opinfo ) {
+               mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
-               if ( moi->moi_flag & MOI_FREEIT ) {
-                       op->o_tmpfree( moi, op->o_tmpmemctx );
-               }
        }
        /* free entry */
        if ( e != NULL ) {
index d6c16665e0b82e47627cc0e868376ae9b491d76f..28f6e7b4aa2dec68acdf84d5e8a1f54a28f5ecf7 100644 (file)
@@ -73,15 +73,9 @@ mdb_hasSubordinates(
        }
 
 done:;
-       moi->moi_ref--;
-       if ( moi->moi_ref < 1 ) {
-               if ( moi->moi_flag & MOI_READER ) {
-                       mdb_txn_reset( moi->moi_txn );
-               }       /* writers can abort themselves */
+       if ( moi == &opinfo ) {
+               mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
-               if ( moi->moi_flag & MOI_FREEIT ) {
-                       op->o_tmpfree( moi, op->o_tmpmemctx );
-               }
        }
        return rc;
 }
index 08fb00391a27a96388464146ae256aacaae2d86e..be74c48492c675aa25be77288c2d377b6e6bb90a 100644 (file)
@@ -139,15 +139,9 @@ mdb_referrals( Operation *op, SlapReply *rs )
        }
 
 done:
-       moi->moi_ref--;
-       if ( moi->moi_ref < 1 ) {
-               if ( moi->moi_flag & MOI_READER ) {
-                       mdb_txn_reset( moi->moi_txn );
-               }       /* writers can abort themselves */
+       if ( moi == &opinfo ) {
+               mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
-               if ( moi->moi_flag & MOI_FREEIT ) {
-                       op->o_tmpfree( moi, op->o_tmpmemctx );
-               }
        }
        if ( e )
                mdb_entry_return( e );
index 52435884a337f5883836fe48bde89b25f5d392f8..efb0a7c6f137eb5b3e71653842db0501b91c50dc 100644 (file)
@@ -815,15 +815,9 @@ nochange:
        rs->sr_err = LDAP_SUCCESS;
 
 done:
-       moi->moi_ref--;
-       if ( moi->moi_ref < 1 ) {
-               if ( moi->moi_flag & MOI_READER ) {
-                       mdb_txn_reset( moi->moi_txn );
-               }       /* writers can abort themselves */
+       if ( moi == &opinfo ) {
+               mdb_txn_reset( moi->moi_txn );
                LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
-               if ( moi->moi_flag & MOI_FREEIT ) {
-                       op->o_tmpfree( moi, op->o_tmpmemctx );
-               }
        }
        if( idcursor )
                mdb_cursor_close( idcursor );