]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#1655, don't retrieve sd until we've checked for valid c_sb.
authorHoward Chu <hyc@openldap.org>
Wed, 20 Mar 2002 23:47:08 +0000 (23:47 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 20 Mar 2002 23:47:08 +0000 (23:47 +0000)
servers/slapd/connection.c

index 952a6315aeb315ff9afbf7334001efea2fb731e5..890b0cac0a5e04aa0e160eae79dec86abe7676a6 100644 (file)
@@ -234,15 +234,15 @@ static Connection* connection_get( ber_socket_t s )
                ber_socket_t i, sd;
 
                for(i=0; i<dtblsize; i++) {
-                       ber_sockbuf_ctrl( connections[i].c_sb,
-                               LBER_SB_OPT_GET_FD, &sd );
-
                        if( connections[i].c_struct_state == SLAP_C_UNINITIALIZED ) {
                                assert( connections[i].c_conn_state == SLAP_C_INVALID );
                                assert( connections[i].c_sb == 0 );
                                break;
                        }
 
+                       ber_sockbuf_ctrl( connections[i].c_sb,
+                               LBER_SB_OPT_GET_FD, &sd );
+
                        if( connections[i].c_struct_state == SLAP_C_UNUSED ) {
                                assert( connections[i].c_conn_state == SLAP_C_INVALID );
                                assert( sd == AC_SOCKET_INVALID );