}
}
- for ( i=0; i<MAXKEYS && uctx.ltu_key[i].ltk_key; i++ ) {
- if (uctx.ltu_key[i].ltk_free)
- uctx.ltu_key[i].ltk_free(
- uctx.ltu_key[i].ltk_key,
- uctx.ltu_key[i].ltk_data );
- }
+ ldap_pvt_thread_pool_context_reset(&uctx);
thread_keys[keyslot].ctx = NULL;
thread_keys[keyslot].id = tid_zero;
ldap_int_thread_userctx_t *ctx = vctx;
int i;
- for ( i=0; i<MAXKEYS && ctx->ltu_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 );