/*
* Empty root entry
*/
-const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, NULL };
+const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, 0, { 0, "" }, NULL };
int entry_destroy(void)
{
#endif
/* initialize reader/writer lock */
- e = (Entry *) ch_malloc( sizeof(Entry) );
+ e = (Entry *) ch_calloc( 1, sizeof(Entry) );
if( e == NULL ) {
#ifdef NEW_LOGGING
/* initialize entry */
e->e_id = NOID;
- e->e_name.bv_val = NULL;
- e->e_name.bv_len = 0;
- e->e_nname.bv_val = NULL;
- e->e_nname.bv_len = 0;
- e->e_attrs = NULL;
- e->e_private = NULL;
/* dn + attributes */
vals[1].bv_val = NULL;
e->e_ndn = NULL;
}
+ if ( e->e_bv.bv_val != NULL ) {
+ free( e->e_bv.bv_val );
+ e->e_bv.bv_val = NULL;
+ }
+
/* free attributes */
attrs_free( e->e_attrs );
e->e_attrs = NULL;
const char *text;
AttributeDescription *ad;
unsigned char *ptr = (unsigned char *)bv->bv_val;
- BVarray bptr;
+ BerVarray bptr;
i = entry_getlen(&ptr);
- x = ch_malloc(i);
+ x = ch_calloc(1, i);
i = entry_getlen(&ptr);
x->e_name.bv_val = ptr;
x->e_name.bv_len = i;
"entry_decode: \"%s\"\n",
x->e_dn, 0, 0 );
#endif
- x->e_private = bv->bv_val;
+ x->e_bv = *bv;
/* A valid entry must have at least one attr, so this
* pointer can never be NULL
*/
x->e_attrs = (Attribute *)(x+1);
- bptr = (BVarray)x->e_attrs;
+ bptr = (BerVarray)x->e_attrs;
a = NULL;
while (i = entry_getlen(&ptr)) {
}
ptr += i + 1;
a->a_desc = ad;
- bptr = (BVarray)(a+1);
+ bptr = (BerVarray)(a+1);
a->a_vals = bptr;
+ a->a_flags = 0;
j = entry_getlen(&ptr);
while (j) {