]> git.sur5r.net Git - openldap/commitdiff
fix leak
authorPierangelo Masarati <ando@openldap.org>
Sat, 2 Jun 2007 10:43:02 +0000 (10:43 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 2 Jun 2007 10:43:02 +0000 (10:43 +0000)
servers/slapd/syntax.c

index b289dd1f65b8469b83833c70ca1d9a377412590a..a2c201a2e8f4c642592d0871e84ee812638ee33c 100644 (file)
@@ -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 );
        }
 }