From: Quanah Gibson-Mount Date: Thu, 30 Apr 2015 03:30:17 +0000 (-0500) Subject: ITS#8120 Move final CHECK_CSN block to before the mutex is unlocked. X-Git-Tag: OPENLDAP_REL_ENG_2_4_41~25 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=98f70f1841f85d931eb2d1659a92cb4ca038cd9d;p=openldap ITS#8120 Move final CHECK_CSN block to before the mutex is unlocked. --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 3fbed97937..2a48325403 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -3922,12 +3922,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; isi_cookieState->cs_num; i++ ) { @@ -3935,6 +3929,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; }