mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
Fix pblock_delete_param(), this function never worked
This commit is contained in:
parent
43ec05a45a
commit
bb04c4eb9d
@ -108,7 +108,6 @@ typedef enum slapi_pblock_class_e {
|
||||
|
||||
struct slapi_pblock {
|
||||
ldap_pvt_thread_mutex_t pblockMutex;
|
||||
int ckParams;
|
||||
int numParams;
|
||||
int curParams[PBLOCK_MAX_PARAMS];
|
||||
void *curVals[PBLOCK_MAX_PARAMS];
|
||||
|
@ -1147,9 +1147,11 @@ pblock_delete_param( Slapi_PBlock *p, int param )
|
||||
pblock_unlock( p );
|
||||
return PBLOCK_ERROR;
|
||||
}
|
||||
|
||||
/* move last parameter to index of deleted parameter */
|
||||
if ( p->numParams > 1 ) {
|
||||
p->curParams[i] = p->curParams[p->numParams];
|
||||
p->curVals[i] = p->curVals[p->numParams];
|
||||
p->curParams[i] = p->curParams[p->numParams - 1];
|
||||
p->curVals[i] = p->curVals[p->numParams - 1];
|
||||
}
|
||||
p->numParams--;
|
||||
|
||||
@ -1165,7 +1167,6 @@ slapi_pblock_new(void)
|
||||
|
||||
pb = (Slapi_PBlock *) ch_calloc( 1, sizeof(Slapi_PBlock) );
|
||||
if ( pb != NULL ) {
|
||||
pb->ckParams = 1;
|
||||
ldap_pvt_thread_mutex_init( &pb->pblockMutex );
|
||||
memset( pb->curParams, 0, sizeof(pb->curParams) );
|
||||
memset( pb->curVals, 0, sizeof(pb->curVals) );
|
||||
|
Loading…
Reference in New Issue
Block a user