]> git.sur5r.net Git - openldap/commitdiff
ITS#6438 check for redundant syncops_free() ?
authorHoward Chu <hyc@openldap.org>
Tue, 5 Jan 2010 03:50:10 +0000 (03:50 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 5 Jan 2010 03:50:10 +0000 (03:50 +0000)
servers/slapd/overlays/syncprov.c

index 8fb306241b947c031300e86b26560e1b51be709a..2cbc9722ccf5895b19abf317457899cbb797473e 100644 (file)
@@ -783,7 +783,8 @@ syncprov_free_syncop( syncops *so )
        GroupAssertion *ga, *gnext;
 
        ldap_pvt_thread_mutex_lock( &so->s_mutex );
-       if ( --so->s_inuse > 0 ) {
+       /* already being freed, or still in use */
+       if ( !so->s_inuse || --so->s_inuse > 0 ) {
                ldap_pvt_thread_mutex_unlock( &so->s_mutex );
                return;
        }