From: Howard Chu Date: Fri, 22 Jan 2016 20:46:23 +0000 (+0000) Subject: ITS#8354 tweak prev commit X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6d2eb36ccbf3c0d0ad28fd1dd16aa2564f658a0f;p=openldap ITS#8354 tweak prev commit Delay mutex init to avoid leaking the mutex --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 9affd0ee67..583f29b6a8 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -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;