]> git.sur5r.net Git - openldap/commitdiff
Plug mutex/rwlock leaks (destroy them)
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 20 Dec 2010 10:57:06 +0000 (10:57 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 20 Dec 2010 10:57:06 +0000 (10:57 +0000)
servers/slapd/back-bdb/cache.c
servers/slapd/backend.c
servers/slapd/overlays/pcache.c
servers/slapd/overlays/syncprov.c
servers/slapd/overlays/translucent.c

index 39a7d290c8db3752d3c0ca193d32d4902c344b48..a42db5c5a20cace55b8d41d309ae599368dbc3aa 100644 (file)
@@ -101,6 +101,7 @@ bdb_cache_entryinfo_free( Cache *cache, EntryInfo *ei )
        cache->c_eifree = ei;
        ldap_pvt_thread_mutex_unlock( &cache->c_eifree_mutex );
 #else
+       ldap_pvt_thread_mutex_destroy( &ei->bei_kids_mutex );
        ch_free( ei );
 #endif
 }
index 58ec6ffb6f81649ee30858343a44675772da895f..a3695ec1be1682e586090300237efae510708295 100644 (file)
@@ -474,6 +474,8 @@ void backend_destroy_one( BackendDB *bd, int dynamic )
                ber_bvarray_free( bd->be_update_refs );
        }
 
+       ldap_pvt_thread_mutex_destroy( &bd->be_pcl_mutex );
+
        if ( dynamic ) {
                free( bd );
        }
@@ -623,6 +625,7 @@ backend_db_init(
                /* If we created and linked this be, remove it and free it */
                if ( !b0 ) {
                        LDAP_STAILQ_REMOVE(&backendDB, be, BackendDB, be_next);
+                       ldap_pvt_thread_mutex_destroy( &be->be_pcl_mutex );
                        ch_free( be );
                        be = NULL;
                        nbackends--;
index 26e28e7de9656c6ce506bc9a823e2e80cfd18cf6..ea9820b045e442537de84322b4e9a376cadeaa95 100644 (file)
@@ -1599,6 +1599,8 @@ add_query(
                templ->query = new_cached_query;
                templ->no_of_queries++;
        } else {
+               ldap_pvt_thread_mutex_destroy(&new_cached_query->answerable_cnt_mutex);
+               ldap_pvt_thread_rdwr_destroy( &new_cached_query->rwlock );
                ch_free( new_cached_query );
                new_cached_query = find_filter( op, qbase->scopes[query->scope],
                                                        query->filter, first );
index b457f4d0e5719aa1de5ee7b3b8873316a5af1c77..72730c0686d96c2a603fd374754494f62bf311ca 100644 (file)
@@ -3170,6 +3170,7 @@ syncprov_db_destroy(
                                se = se_next;
                        }
                                
+                       ldap_pvt_thread_mutex_destroy(&si->si_logs->sl_mutex);
                        ch_free( si->si_logs );
                }
                if ( si->si_ctxcsn )
index d6ac0691a0b87bd97cb17ebcceeb6f6f6c814ee4..63f283c009153915b78e2191bfe2df6f7853864f 100644 (file)
@@ -1383,6 +1383,7 @@ translucent_db_destroy( BackendDB *be, ConfigReply *cr )
                        backend_stopdown_one( &ov->db );
                }
 
+               ldap_pvt_thread_mutex_destroy( &ov->db.be_pcl_mutex );
                ch_free(ov);
                on->on_bi.bi_private = NULL;
        }