mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 01:29:59 -05:00
Use calloc for new Entries, take care of new e_ocflags field
This commit is contained in:
parent
480d50d883
commit
306e15d3bd
1 changed files with 3 additions and 9 deletions
|
|
@ -24,7 +24,7 @@ static int emaxsize;/* max size of ebuf */
|
|||
/*
|
||||
* Empty root entry
|
||||
*/
|
||||
const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, NULL };
|
||||
const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, 0, NULL };
|
||||
|
||||
int entry_destroy(void)
|
||||
{
|
||||
|
|
@ -71,7 +71,7 @@ str2entry( char *s )
|
|||
#endif
|
||||
|
||||
/* initialize reader/writer lock */
|
||||
e = (Entry *) ch_malloc( sizeof(Entry) );
|
||||
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
|
||||
|
||||
if( e == NULL ) {
|
||||
#ifdef NEW_LOGGING
|
||||
|
|
@ -87,12 +87,6 @@ str2entry( char *s )
|
|||
|
||||
/* 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;
|
||||
|
|
@ -564,7 +558,7 @@ int entry_decode(struct berval *bv, Entry **e)
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue