Fix entry_alloc with no attrs

This commit is contained in:
Howard Chu 2011-09-14 10:14:02 -07:00
parent 0e96868e8e
commit 04311cc716

View file

@ -177,8 +177,12 @@ static Entry * mdb_entry_alloc(
nvals * sizeof(struct berval), op->o_tmpmemctx );
BER_BVZERO(&e->e_bv);
e->e_private = e;
e->e_attrs = (Attribute *)(e+1);
e->e_attrs->a_vals = (struct berval *)(e->e_attrs+nattrs);
if (nattrs) {
e->e_attrs = (Attribute *)(e+1);
e->e_attrs->a_vals = (struct berval *)(e->e_attrs+nattrs);
} else {
e->e_attrs = NULL;
}
return e;
}