From: Howard Chu Date: Fri, 25 Jan 2002 07:11:52 +0000 (+0000) Subject: Added Entry->e_bv for entry_decode X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~32 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1226d620e0650e19c9268f40343bb7f3259e5317;p=openldap Added Entry->e_bv for entry_decode --- diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index aafaa82929..7c01ac87a2 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -24,7 +24,7 @@ static int emaxsize;/* max size of ebuf */ /* * Empty root entry */ -const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, 0, NULL }; +const Entry slap_entry_root = { NOID, { 0, "" }, { 0, "" }, NULL, 0, { 0, "" }, NULL }; int entry_destroy(void) { @@ -363,6 +363,11 @@ entry_free( Entry *e ) 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; @@ -575,7 +580,7 @@ int entry_decode(struct berval *bv, Entry **e) "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 diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index f0d8dc31a0..4c1e7c0819 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -756,6 +756,8 @@ typedef struct slap_entry { slap_mask_t e_ocflags; + struct berval e_bv; /* For entry_encode/entry_decode */ + /* for use by the backend for any purpose */ void* e_private; } Entry;