From: Howard Chu Date: Wed, 4 Jun 2014 09:23:18 +0000 (-0700) Subject: Plug one-time leaks X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=45ff842542644c52824d9706da6e2af2801c99a2;p=openldap Plug one-time leaks --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index dea3985f9e..44f9544b58 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -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; iltp_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); diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 9d49d2b21b..beef2edaf5 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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 );