]> git.sur5r.net Git - openldap/commitdiff
ITS#8120 Move final CHECK_CSN block to before the mutex is unlocked.
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 30 Apr 2015 03:30:17 +0000 (22:30 -0500)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 30 Apr 2015 03:30:17 +0000 (22:30 -0500)
servers/slapd/syncrepl.c

index 04e386284780f552c80fe3b382c94f6975ab3ceb..255ca5bcc7deec260acfe581ce1ca75acccf504c 100644 (file)
@@ -3926,12 +3926,6 @@ syncrepl_updateCookie(
                ch_free( sc.sids );
                ber_bvarray_free( sc.ctxcsn );
        }
-       ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
-
-       op->o_bd = be;
-       op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx );
-       BER_BVZERO( &op->o_csn );
-       if ( mod.sml_next ) slap_mods_free( mod.sml_next, 1 );
 
 #ifdef CHECK_CSN
        for ( i=0; i<si->si_cookieState->cs_num; i++ ) {
@@ -3939,6 +3933,13 @@ syncrepl_updateCookie(
        }
 #endif
 
+       ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
+
+       op->o_bd = be;
+       op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx );
+       BER_BVZERO( &op->o_csn );
+       if ( mod.sml_next ) slap_mods_free( mod.sml_next, 1 );
+
        return rc;
 }