mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Fix SLAPI_ADD_RESCONTROLS
This commit is contained in:
parent
4a8bb3991f
commit
1b98cd6262
@ -321,8 +321,13 @@ set( Slapi_PBlock *pb, int param, void *val )
|
||||
LDAPControl **ctrls = pb->curVals[i];
|
||||
int j;
|
||||
|
||||
for (j=0; ctrls[j]; j++);
|
||||
ctrls = ch_realloc( ctrls, (j+2)*sizeof(LDAPControl *) );
|
||||
if ( ctrls ) {
|
||||
for (j=0; ctrls[j]; j++);
|
||||
ctrls = ch_realloc( ctrls, (j+2)*sizeof(LDAPControl *) );
|
||||
} else {
|
||||
ctrls = ch_malloc( 2 * sizeof(LDAPControl *) );
|
||||
j = 0;
|
||||
}
|
||||
ctrls[j] = val;
|
||||
ctrls[j+1] = NULL;
|
||||
pb->curVals[i] = ctrls;
|
||||
|
Loading…
Reference in New Issue
Block a user