From 96876a171a19c2f922bbc6fa09c964b78d363d49 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 7 Jun 2012 16:02:45 -0700 Subject: [PATCH] ITS#7292 more syncprov leaks --- servers/slapd/overlays/syncprov.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 ) { -- 2.39.5