From: Pierangelo Masarati Date: Sat, 2 Jun 2007 10:43:02 +0000 (+0000) Subject: fix leak X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~427 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=457b5b11ae0eef8ed23565c22d889e6547aeb971;p=openldap fix leak --- diff --git a/servers/slapd/syntax.c b/servers/slapd/syntax.c index b289dd1f65..a2c201a2e8 100644 --- a/servers/slapd/syntax.c +++ b/servers/slapd/syntax.c @@ -108,13 +108,16 @@ syn_is_sup( Syntax *syn, Syntax *sup ) void syn_destroy( void ) { - Syntax *s; - - avl_free(syn_index, ldap_memfree); - while( !LDAP_SLIST_EMPTY(&syn_list) ) { - s = LDAP_SLIST_FIRST(&syn_list); - LDAP_SLIST_REMOVE_HEAD(&syn_list, ssyn_next); - ldap_syntax_free((LDAPSyntax *)s); + Syntax *s; + + avl_free( syn_index, ldap_memfree ); + while( !LDAP_SLIST_EMPTY( &syn_list ) ) { + s = LDAP_SLIST_FIRST( &syn_list ); + LDAP_SLIST_REMOVE_HEAD( &syn_list, ssyn_next ); + if ( s->ssyn_sups ) { + SLAP_FREE( s->ssyn_sups ); + } + ldap_syntax_free( (LDAPSyntax *)s ); } }