mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
add helper
This commit is contained in:
parent
f19df0a307
commit
1b499a7d7c
@ -78,6 +78,20 @@ cr_bvfind( struct berval *crname )
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
static int
|
||||
cr_destroy_one( ContentRule *c )
|
||||
{
|
||||
assert( c != NULL );
|
||||
|
||||
if (c->scr_auxiliaries) ldap_memfree(c->scr_auxiliaries);
|
||||
if (c->scr_required) ldap_memfree(c->scr_required);
|
||||
if (c->scr_allowed) ldap_memfree(c->scr_allowed);
|
||||
if (c->scr_precluded) ldap_memfree(c->scr_precluded);
|
||||
ldap_contentrule_free((LDAPContentRule *)c);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
cr_destroy( void )
|
||||
{
|
||||
@ -89,11 +103,7 @@ cr_destroy( void )
|
||||
c = LDAP_SLIST_FIRST(&cr_list);
|
||||
LDAP_SLIST_REMOVE_HEAD(&cr_list, scr_next);
|
||||
|
||||
if (c->scr_auxiliaries) ldap_memfree(c->scr_auxiliaries);
|
||||
if (c->scr_required) ldap_memfree(c->scr_required);
|
||||
if (c->scr_allowed) ldap_memfree(c->scr_allowed);
|
||||
if (c->scr_precluded) ldap_memfree(c->scr_precluded);
|
||||
ldap_contentrule_free((LDAPContentRule *)c);
|
||||
cr_destroy_one( c );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user