From: Howard Chu Date: Thu, 25 Jan 2007 11:13:15 +0000 (+0000) Subject: Free thread keys in reverse order of allocation X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~140 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2298595ea3b398d6dd33af406965a24c297e87df;p=openldap Free thread keys in reverse order of allocation --- diff --git a/libraries/libldap_r/tpool.c b/libraries/libldap_r/tpool.c index d8a4f53ceb..a6ba2062ba 100644 --- a/libraries/libldap_r/tpool.c +++ b/libraries/libldap_r/tpool.c @@ -720,12 +720,7 @@ ldap_int_thread_pool_wrapper ( } } - for ( i=0; iltu_key[i].ltk_key; i++) { + for ( i=MAXKEYS-1; i>=0; i--) { + if ( !ctx->ltu_key[i].ltk_key ) + continue; if ( ctx->ltu_key[i].ltk_free ) ctx->ltu_key[i].ltk_free( ctx->ltu_key[i].ltk_key, ctx->ltu_key[i].ltk_data );