From: Arran Cudbard-Bell Date: Wed, 11 Jul 2012 09:51:49 +0000 (+0100) Subject: Need to mark the connection as unused before attempting to close it X-Git-Tag: release_3_0_0_beta0~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1c3e1cea746c8cefc217874e335183601eb096a;p=thirdparty%2Ffreeradius-server.git Need to mark the connection as unused before attempting to close it --- diff --git a/src/main/connection.c b/src/main/connection.c index e545cdafe7e..cd122338018 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -700,7 +700,7 @@ void *fr_connection_reconnect(fr_connection_pool_t *fc, void *conn) if (!fc || !conn) return NULL; - this= fr_connection_find(fc, conn); + this = fr_connection_find(fc, conn); if (!this) return NULL; conn_number = this->number; @@ -718,8 +718,13 @@ void *fr_connection_reconnect(fr_connection_pool_t *fc, void *conn) } else { fc->last_complained = now; } - - fr_connection_close(fc, conn); + + this->used = FALSE; + + rad_assert(fc->active > 0); + fc->active--; + + fr_connection_close(fc, this); pthread_mutex_unlock(&fc->mutex); /*