From: Alan T. DeKok Date: Mon, 18 Feb 2013 18:28:12 +0000 (-0500) Subject: Unlock mutex when we find a matching connection X-Git-Tag: release_3_0_0_beta1~1041 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84fa208a76fc6415d4e5f4c6cb4f1101799b3c89;p=thirdparty%2Ffreeradius-server.git Unlock mutex when we find a matching connection --- diff --git a/src/main/connection.c b/src/main/connection.c index 0ceaa39ea2c..d75b3fa2d55 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -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; }