From: Howard Chu Date: Thu, 7 Jun 2012 23:02:45 +0000 (-0700) Subject: ITS#7292 more syncprov leaks X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96876a171a19c2f922bbc6fa09c964b78d363d49;p=openldap ITS#7292 more syncprov leaks --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 3a8c62649e..11dcbc20f7 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -918,14 +918,16 @@ syncprov_qplay( Operation *op, syncops *so ) do { ldap_pvt_thread_mutex_lock( &so->s_mutex ); + /* Exit loop with mutex held */ + if ( so->s_op->o_abandon ) + break; sr = so->s_res; - if ( sr ) - so->s_res = sr->s_next; - if ( !so->s_res ) - so->s_restail = NULL; /* Exit loop with mutex held */ - if ( !sr || so->s_op->o_abandon ) + if ( !sr ) break; + so->s_res = sr->s_next; + if ( !so->s_res ) + so->s_restail = NULL; ldap_pvt_thread_mutex_unlock( &so->s_mutex ); if ( sr->s_mode == LDAP_SYNC_NEW_COOKIE ) {