From: Howard Chu Date: Sun, 9 Dec 2001 01:14:32 +0000 (+0000) Subject: Clean up bdb_entry_release / bdb_entry_return X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~695 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=109307547e76c68814934db905fe4b56943d54a5;p=openldap Clean up bdb_entry_release / bdb_entry_return --- diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index eb40b6bac7..e2db8cd065 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -149,7 +149,12 @@ int bdb_entry_return( if( (void *) e->e_attrs != (void *) (e+1)) { attrs_free( e->e_attrs ); } - if( e->e_private ) { +#ifdef BDB_HIER + /* We had to construct the dn and ndn as well, in a single block */ + free( e->e_dn ); +#endif + /* In tool mode the e_private buffer is realloc'd, leave it alone */ + if( e->e_private && !(slapMode & SLAP_TOOL_MODE) ) { free( e->e_private ); } @@ -165,14 +170,5 @@ int bdb_entry_release( Entry *e, int rw ) { - /* A tool will call this with NULL Connection and Operation - * pointers. We don't need to free the e_private in that case, - * because the tool is getting entries into a realloc'd - * buffer. - */ - if( c && o ) { - return bdb_entry_return( be, e ); - } else { - free( e ); - } + return bdb_entry_return( be, e ); }