From: Pierangelo Masarati Date: Tue, 19 Jul 2005 14:38:34 +0000 (+0000) Subject: AttributeType cleanup X-Git-Tag: OPENLDAP_AC_BP~329 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=707082fcb7d4699c0739e34029e472b97ebd1f4b;p=openldap AttributeType cleanup --- diff --git a/servers/slapd/at.c b/servers/slapd/at.c index 423a6d38e1..cc4e5ed725 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -214,7 +214,31 @@ at_destroy( void ) a = LDAP_STAILQ_FIRST(&attr_list); LDAP_STAILQ_REMOVE_HEAD(&attr_list, sat_next); - if (a->sat_subtypes) ldap_memfree(a->sat_subtypes); + if ( a->sat_equality ) { + MatchingRule *mr; + + mr = mr_find( a->sat_equality->smr_oid ); + assert( mr != NULL ); + if ( mr != a->sat_equality ) { + ch_free( a->sat_equality ); + a->sat_equality = NULL; + } + } + + assert( a->sat_syntax != NULL ); + if ( a->sat_syntax != NULL ) { + Syntax *syn; + + syn = syn_find( a->sat_syntax->ssyn_oid ); + assert( syn != NULL ); + if ( syn != a->sat_syntax ) { + ch_free( a->sat_syntax ); + a->sat_syntax = NULL; + } + } + + if ( a->sat_oidmacro ) ldap_memfree( a->sat_oidmacro ); + if ( a->sat_subtypes ) ldap_memfree( a->sat_subtypes ); ad_destroy(a->sat_ad); ldap_pvt_thread_mutex_destroy(&a->sat_ad_mutex); ldap_attributetype_free((LDAPAttributeType *)a); @@ -383,10 +407,10 @@ at_insert( int at_add( - LDAPAttributeType *at, - int user, - AttributeType **rsat, - const char **err ) + LDAPAttributeType *at, + int user, + AttributeType **rsat, + const char **err ) { AttributeType *sat; MatchingRule *mr;