From e6bf5795acbe2ab5b98c9068ee0b41406a016369 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 26 Mar 2021 13:46:56 +0000 Subject: [PATCH] ITS#9498 replace asserts Just no-op if trying to close a connection that's already being closed. --- servers/slapd/connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 5bd9fb831c..a2d2c568dc 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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 */