ITS#8354 tweak prev commit

Delay mutex init to avoid leaking the mutex
This commit is contained in:
Howard Chu 2016-01-22 20:46:23 +00:00
parent 4773850d42
commit 6d2eb36ccb

View file

@ -2544,7 +2544,6 @@ syncprov_op_search( Operation *op, SlapReply *rs )
}
sop = ch_malloc( sizeof( syncops ));
*sop = so;
ldap_pvt_thread_mutex_init( &sop->s_mutex );
sop->s_rid = srs->sr_state.rid;
sop->s_sid = srs->sr_state.sid;
/* set refcount=2 to prevent being freed out from under us
@ -2574,6 +2573,7 @@ syncprov_op_search( Operation *op, SlapReply *rs )
ldap_pvt_thread_yield();
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
}
ldap_pvt_thread_mutex_init( &sop->s_mutex );
sop->s_next = si->si_ops;
sop->s_si = si;
si->si_ops = sop;