Fix SLAPI_ADD_RESCONTROLS

This commit is contained in:
Howard Chu 2004-03-02 20:31:37 +00:00
parent 4a8bb3991f
commit 1b98cd6262

View File

@ -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;