sizeof(struct berval *) );
for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ ) {
/* Take ownership of original values. */
+ modp->mod_bvalues[j] = (struct berval *)ch_malloc( sizeof(struct berval) );
modp->mod_bvalues[j]->bv_len = ml->sml_bvalues[j].bv_len;
modp->mod_bvalues[j]->bv_val = ml->sml_bvalues[j].bv_val;
ml->sml_bvalues[j].bv_len = 0;
*/
static void FreeLDAPMods (LDAPMod **mods)
{
- int i;
+ int i, j;
if (mods == NULL)
return;
* Modification list. Do free the containing array.
*/
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
+ for ( j = 0; mods[i]->mod_bvalues[j] != NULL; j++ ) {
+ ch_free( mods[i]->mod_bvalues[j] );
+ }
ch_free( mods[i]->mod_bvalues );
} else {
ch_free( mods[i]->mod_values );