mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
Fix SLAPI_ADD_RESCONTROLS
This commit is contained in:
parent
4a8bb3991f
commit
1b98cd6262
1 changed files with 7 additions and 2 deletions
|
|
@ -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 a new issue