Use counters even if there's no parent
authorAlan T. DeKok <aland@freeradius.org>
Sun, 11 May 2014 15:42:03 +0000 (11:42 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 11 May 2014 15:42:03 +0000 (11:42 -0400)
src/main/listen.c

index e1fb309..c6efeb2 100644 (file)
@@ -708,12 +708,10 @@ static void common_socket_free(rad_listen_t *this)
 
        if (sock->proto != IPPROTO_TCP) return;
 
-       if (!sock->parent) return;
-
        /*
         *      Decrement the number of connections.
         */
-       if (sock->parent->limit.num_connections > 0) {
+       if (sock->parent && (sock->parent->limit.num_connections > 0)) {
                sock->parent->limit.num_connections--;
        }
        if (sock->client && sock->client->limit.num_connections > 0) {