]> git.sur5r.net Git - openldap/commitdiff
Don't destroy uninitialized connections...
authorKurt Zeilenga <kurt@openldap.org>
Wed, 28 Apr 1999 20:33:25 +0000 (20:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 28 Apr 1999 20:33:25 +0000 (20:33 +0000)
servers/slapd/connection.c

index 3ee0a7d05867e55177cd0f6d46f7b1215ba54da2..25bf3d468c5f2d37b308389955d1b3984e83101e 100644 (file)
@@ -100,9 +100,11 @@ int connections_destroy(void)
        }
 
        for ( i = 0; i < dtblsize; i++ ) {
-               ldap_pvt_thread_mutex_destroy( &connections[i].c_mutex );
-               ldap_pvt_thread_mutex_destroy( &connections[i].c_write_mutex );
-               ldap_pvt_thread_cond_destroy( &connections[i].c_write_cv );
+               if( connections[i].c_struct_state != SLAP_C_UNINITIALIZED ) {
+                       ldap_pvt_thread_mutex_destroy( &connections[i].c_mutex );
+                       ldap_pvt_thread_mutex_destroy( &connections[i].c_write_mutex );
+                       ldap_pvt_thread_cond_destroy( &connections[i].c_write_cv );
+               }
 
                free( &connections[i] );
        }