mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 19:19:35 -05:00
Preserve key order when deleting, so context_reset will free last keys first.
This commit is contained in:
parent
7c6b26a68f
commit
45389c0341
1 changed files with 2 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue