Skip to content
Snippets Groups Projects
Commit aa983f34 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Clean up entry_free()

assert of e_private was not freed by caller
parent 383391b4
No related branches found
No related tags found
No related merge requests found
......@@ -320,8 +320,14 @@ entry2str(
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;
......@@ -330,12 +336,11 @@ entry_free( Entry *e )
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 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment