#include <ac/string.h>
#include "slap.h"
+#include "ldif.h"
static unsigned char *ebuf; /* buf returned by entry2str */
static unsigned char *ecur; /* pointer to end of currently used ebuf */
*/
#ifdef NEW_LOGGING
- LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
+ LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"str2entry: \"%s\"\n", s ? s : "NULL" ));
#else
Debug( LDAP_DEBUG_TRACE, "=> str2entry\n",
void
entry_free( Entry *e )
{
- Attribute *a, *next;
+ /* free an entry structure */
+ assert( e != NULL );
+
+ /* e_private must be freed by the caller */
+ assert( e->e_private == NULL );
+ e->e_private = NULL;
+ /* free DNs */
if ( e->e_dn != NULL ) {
free( e->e_dn );
e->e_dn = NULL;
free( e->e_ndn );
e->e_ndn = NULL;
}
- for ( a = e->e_attrs; a != NULL; a = next ) {
- next = a->a_next;
- attr_free( a );
- }
+
+ /* free attributes */
+ attrs_free( e->e_attrs );
e->e_attrs = NULL;
- e->e_private = NULL;
+
free( e );
}
BerElement *ber;
#ifdef NEW_LOGGING
- LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
+ LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"entry_encode: id: 0x%08lx \"%s\"\n",
e->e_id, e->e_dn ));
#else