diff --git a/src/main/listen.c b/src/main/listen.c
index cb774d5..e39ee4f 100644
--- a/src/main/listen.c
+++ b/src/main/listen.c
@@ -476,14 +476,4 @@ static int dual_tcp_recv(rad_listen_t *listener)
 
 		/*
-		 *	Decrement the number of connections.
-		 */
-		if (sock->parent->limit.num_connections > 0) {
-			sock->parent->limit.num_connections--;
-		}
-		if (sock->client->limit.num_connections > 0) {
-			sock->client->limit.num_connections--;
-		}
-
-		/*
 		 *	Tell the event handler that an FD has disappeared.
 		 */
diff --git a/src/main/process.c b/src/main/process.c
index bc1b35e..6b369d8 100644
--- a/src/main/process.c
+++ b/src/main/process.c
@@ -1603,5 +1603,5 @@ static void remove_from_proxy_hash_nl(REQUEST *request)
 
 	/*
-	 *	Got from YES in hash, to NO, not in hash while we hold
+	 *	Go from YES in hash, to NO, not in hash while we hold
 	 *	the mutex.  This guarantees that when another thread
 	 *	grabs the mutex, the "not in hash" flag is correct.
@@ -3770,4 +3770,13 @@ finish:
 #endif
 
+		if (sock->parent) {
+			if (sock->parent->limit.num_connections > 0) {
+				sock->parent->limit.num_connections--;
+			}
+			if (sock->client->limit.num_connections > 0) {
+				sock->client->limit.num_connections--;
+			}
+		}
+
 		/*
 		 *	Remove any pending cleanups.
diff --git a/src/main/tls_listen.c b/src/main/tls_listen.c
index 91eeec8..d7edacd 100644
--- a/src/main/tls_listen.c
+++ b/src/main/tls_listen.c
@@ -77,16 +77,4 @@ static void tls_socket_close(rad_listen_t *listener)
 	listener->tls = NULL; /* parent owns this! */
 	
-	if (sock->parent) {
-		/*
-		 *	Decrement the number of connections.
-		 */
-		if (sock->parent->limit.num_connections > 0) {
-			sock->parent->limit.num_connections--;
-		}
-		if (sock->client->limit.num_connections > 0) {
-			sock->client->limit.num_connections--;
-		}
-	}
-	
 	/*
 	 *	Tell the event handler that an FD has disappeared.
