]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Unlock mutex when we find a matching connection
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:28:12 +0000 (13:28 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Feb 2013 18:31:57 +0000 (13:31 -0500)
src/main/connection.c

index 0ceaa39ea2c3856dfc3eda0c1e7e6d0c5b32aba4..d75b3fa2d555b28b746589afab5f37f78165fd37 100644 (file)
@@ -456,10 +456,13 @@ static fr_connection_t *fr_connection_find(fr_connection_pool_t *pool, void *con
         *      order to find top of the parent structure.
         */
        for (this = pool->head; this != NULL; this = this->next) {
-               if (this->connection == conn) return this;
+               if (this->connection == conn) {
+                       pthread_mutex_unlock(&pool->mutex);
+                       return this;
+               }
        }
 
-       pthread_mutex_unlock(&pool->mutex);
+
        return NULL;
 }