From 457b5b11ae0eef8ed23565c22d889e6547aeb971 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 2 Jun 2007 10:43:02 +0000 Subject: [PATCH] fix leak --- servers/slapd/syntax.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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 ); } } -- 2.39.5