From 2c34d2fda687c490d78af3fd23bf3d245d239ffe Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Wed, 29 Apr 2015 22:30:17 -0500 Subject: [PATCH] ITS#8120 Move final CHECK_CSN block to before the mutex is unlocked. --- servers/slapd/syncrepl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 04e3862847..255ca5bcc7 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -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; isi_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; } -- 2.39.5