]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
protect assertion behind mutex (test should be atomic anyway...)
authorPierangelo Masarati <ando@openldap.org>
Thu, 14 Dec 2006 19:22:00 +0000 (19:22 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 14 Dec 2006 19:22:00 +0000 (19:22 +0000)
servers/slapd/connection.c

index 7a46410ab55aac83e35ef20b7dab8911e2af10b7..4534075be1b80ed802a9bdb8f2c91d0d14fec399 100644 (file)
@@ -303,10 +303,10 @@ static Connection* connection_get( ber_socket_t s )
        if( c != NULL ) {
                ber_socket_t    sd;
 
-               assert( c->c_struct_state != SLAP_C_UNINITIALIZED );
-
                ldap_pvt_thread_mutex_lock( &c->c_mutex );
 
+               assert( c->c_struct_state != SLAP_C_UNINITIALIZED );
+
                ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
                if( c->c_struct_state != SLAP_C_USED ) {
                        /* connection must have been closed due to resched */