Plug mutex/rwlock leaks (destroy them)

This commit is contained in:
Hallvard Furuseth 2010-12-20 10:57:06 +00:00
parent 78a0be6a42
commit 720aa4b77e
5 changed files with 8 additions and 0 deletions

View 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
}

View 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--;

View 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 );

View 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 )

View 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;
}