attrs_free( e->e_attrs );
}
e->e_attrs = new->e_attrs;
-#ifdef BDB_HIER
- ch_free(e->e_name.bv_val);
-#else
if( e->e_nname.bv_val < e->e_bv.bv_val || e->e_nname.bv_val >
e->e_bv.bv_val + e->e_bv.bv_len ) {
ch_free(e->e_name.bv_val);
ch_free(e->e_nname.bv_val);
}
-#endif
e->e_name = new->e_name;
e->e_nname = new->e_nname;
e->e_name.bv_len = rlen - 1;
e->e_nname.bv_len = nrlen - 1;
- e->e_name.bv_val = ch_malloc(rlen + nrlen);
- e->e_nname.bv_val = e->e_name.bv_val + rlen;
+ e->e_name.bv_val = ch_malloc(rlen);
+ e->e_nname.bv_val = ch_malloc(nrlen);
ptr = e->e_name.bv_val;
nptr = e->e_nname.bv_val;
for ( ei = BEI(e); ei && ei->bei_id; ei=ei->bei_parent ) {
attrs_free( e->e_attrs );
}
-#ifndef BDB_HIER
/* See if the DNs were changed by modrdn */
if( e->e_nname.bv_val < e->e_bv.bv_val || e->e_nname.bv_val >
e->e_bv.bv_val + e->e_bv.bv_len ) {
e->e_name.bv_val = NULL;
e->e_nname.bv_val = NULL;
}
+#ifndef BDB_HIER
/* In tool mode the e_bv buffer is realloc'd, leave it alone */
if( !(slapMode & SLAP_TOOL_MODE) ) {
free( e->e_bv.bv_val );
}
#else
- /* We had to construct the dn and ndn as well, in a single block */
- if( e->e_name.bv_val ) {
- free( e->e_name.bv_val );
- }
free( e->e_bv.bv_val );
#endif
free( e );
* already happened, must free the names. The frees are
* done in bdb_cache_modrdn().
*/
-#ifdef BDB_HIER
- e->e_name.bv_val = ch_malloc(new_dn.bv_len + new_ndn.bv_len + 2);
- e->e_name.bv_len = new_dn.bv_len;
- e->e_nname.bv_val = e->e_name.bv_val + new_dn.bv_len + 1;
- e->e_nname.bv_len = new_ndn.bv_len;
- strcpy(e->e_name.bv_val, new_dn.bv_val);
- strcpy(e->e_nname.bv_val, new_ndn.bv_val);
-#else
if( e->e_nname.bv_val < e->e_bv.bv_val || e->e_nname.bv_val >
e->e_bv.bv_val + e->e_bv.bv_len ) {
e->e_name.bv_val = NULL;
e->e_nname = new_ndn;
new_dn.bv_val = NULL;
new_ndn.bv_val = NULL;
-#endif
+
/* add new one */
rs->sr_err = bdb_dn2id_add( op->o_bd, lt2, neip ? neip : eip, e,
op->o_tmpmemctx );