next = ml->sml_next;
slapi_ch_free( (void **)&ml->sml_bvalues );
+#ifdef SLAP_NVALUES
+ slapi_ch_free( (void **)&ml->sml_nvalues );
+#endif
slapi_ch_free( (void **)&ml );
}
}
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
tmp.sml_bvalues = bv;
+#ifdef SLAP_NVALUES
+ tmp.sml_nvalues = NULL;
+#endif
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
+#ifdef SLAP_NVALUES
+ mod->sml_nvalues = tmp.sml_nvalues;
+#endif
*modtail = mod;
modtail = &mod->sml_next;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
tmp.sml_bvalues = bv;
+#ifdef SLAP_NVALUES
+ tmp.sml_nvalues = NULL;
+#endif
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
+#ifdef SLAP_NVALUES
+ mod->sml_nvalues = tmp.sml_nvalues;
+#endif
*modtail = mod;
modtail = &mod->sml_next;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
tmp.sml_bvalues = bv;
+#ifdef SLAP_NVALUES
+ tmp.sml_nvalues = NULL;
+#endif
mod = (Modifications *)ch_malloc( sizeof(Modifications) );
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
+#ifdef SLAP_NVALUES
+ mod->sml_nvalues = tmp.sml_nvalues;
+#endif
} else {
rc = values2obj( pMod->mod_values, &bv );
if ( rc != LDAP_SUCCESS ) goto cleanup;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
tmp.sml_bvalues = bv;
+#ifdef SLAP_NVALUES
+ tmp.sml_nvalues = NULL;
+#endif
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
mod->sml_bvalues = tmp.sml_bvalues;
+#ifdef SLAP_NVALUES
+ mod->sml_nvalues = tmp.sml_nvalues;
+#endif
}
*modtail = mod;
modtail = &mod->sml_next;
}
if ( vals == NULL ) {
- /* Apparently vals can be NULL */
+ /* Apparently vals can be NULL
+ * FIXME: sm_bvalues = NULL ? */
mod.sm_bvalues = (BerVarray)ch_malloc( sizeof(struct berval) );
mod.sm_bvalues->bv_val = NULL;
+
} else {
rc = bvptr2obj( vals, &mod.sm_bvalues );
if ( rc != LDAP_SUCCESS ) {
return LDAP_CONSTRAINT_VIOLATION;
}
}
+#ifdef SLAP_NVALUES
+ mod.sm_nvalues = NULL;
+#endif
rc = modify_add_values( e, &mod, 0, &text, textbuf, sizeof(textbuf) );
if ( rc != LDAP_SUCCESS ) {
return LDAP_CONSTRAINT_VIOLATION;
}
+#if SLAP_NVALUES
+ mod.sm_nvalues = NULL;
+#endif
rc = modify_delete_values( e, &mod, 0, &text, textbuf, sizeof(textbuf) );
}
mod->sml_bvalues[i].bv_val = NULL;
}
+#ifdef SLAP_NVALUES
+ mod->sml_nvalues = NULL;
+#endif
*modtail = mod;
modtail = &mod->sml_next;