Skip to content
Snippets Groups Projects
Commit 45389c03 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

Preserve key order when deleting, so context_reset will free last keys first.

parent 7c6b26a6
No related branches found
No related tags found
No related merge requests found
......@@ -844,12 +844,8 @@ int ldap_pvt_thread_pool_getkey(
static void
clear_key_idx( ldap_int_thread_userctx_t *ctx, int i )
{
int j = i;
while ( ++j < MAXKEYS && ctx->ltu_key[j].ltk_key );
if ( --j != i ) {
ctx->ltu_key[i] = ctx->ltu_key[j];
i = j;
}
for ( ; i < MAXKEYS-1 && ctx->ltu_key[i+1].ltk_key; i++ )
ctx->ltu_key[i] = ctx->ltu_key[i+1];
ctx->ltu_key[i].ltk_key = NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment