]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9498 replace asserts
authorHoward Chu <hyc@openldap.org>
Fri, 26 Mar 2021 13:46:56 +0000 (13:46 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 26 Mar 2021 13:46:56 +0000 (13:46 +0000)
Just no-op if trying to close a connection that's already being closed.

servers/slapd/connection.c

index 5bd9fb831c39aaccc7b814019cf2e8ef280c6fbb..a2d2c568dce6a3ba3fa2a8511f4837a8baa8bf16 100644 (file)
@@ -763,7 +763,8 @@ void connection_closing( Connection *c, const char *why )
        assert( connections != NULL );
        assert( c != NULL );
 
-       assert( c->c_conn_state != SLAP_C_INVALID );
+       if( c->c_conn_state == SLAP_C_INVALID )
+               return;
 
        /* c_mutex must be locked by caller */
 
@@ -796,7 +797,8 @@ connection_close( Connection *c )
        assert( connections != NULL );
        assert( c != NULL );
 
-       assert( c->c_conn_state == SLAP_C_CLOSING );
+       if ( c->c_conn_state != SLAP_C_CLOSING )
+               return;
 
        /* NOTE: c_mutex should be locked by caller */