Plug one-time leaks

This commit is contained in:
Howard Chu 2014-06-04 02:23:18 -07:00
parent 71ff674a02
commit 45ff842542
2 changed files with 10 additions and 1 deletions

View File

@ -826,6 +826,13 @@ ldap_pvt_thread_pool_destroy ( ldap_pvt_thread_pool_t *tpool, int run_pending )
ldap_pvt_thread_cond_destroy(&pool->ltp_pcond);
ldap_pvt_thread_cond_destroy(&pool->ltp_cond);
ldap_pvt_thread_mutex_destroy(&pool->ltp_mutex);
for (i=0; i<pool->ltp_numqs; i++) {
pq = pool->ltp_wqs[i];
if (pq->ltp_free) {
LDAP_FREE(pq->ltp_free);
}
}
LDAP_FREE(pool->ltp_wqs);
LDAP_FREE(pool);
*tpool = NULL;
ldap_int_has_thread_pool = 0;
@ -976,6 +983,7 @@ ldap_int_thread_pool_wrapper (
ldap_pvt_thread_cond_destroy(&pq->ltp_cond);
ldap_pvt_thread_mutex_destroy(&pq->ltp_mutex);
LDAP_FREE(pq->ltp_free);
pq->ltp_free = NULL;
}
ldap_pvt_thread_exit(NULL);
return(NULL);

View File

@ -3661,7 +3661,8 @@ loglevel2bvarray( int l, BerVarray *bva )
}
if ( l == 0 ) {
return value_add_one( bva, ber_bvstr( "0" ) );
struct berval bv = BER_BVC("0");
return value_add_one( bva, &bv );
}
return mask_to_verbs( loglevel_ops, l, bva );