From: Arran Cudbard-Bell Date: Tue, 30 May 2017 00:39:32 +0000 (-0400) Subject: CID 1400058: Dumb false positive X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75c7acd6a4fbe69769e52ff2d67cb57790148ab8;p=thirdparty%2Ffreeradius-server.git CID 1400058: Dumb false positive --- diff --git a/src/main/connection.c b/src/main/connection.c index 5eeea0afe05..077e694a583 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -1059,8 +1059,18 @@ fr_connection_pool_t *fr_connection_pool_init(TALLOC_CTX *ctx, cf_log_err_cs(cs, "Cannot set 'max' to zero"); goto error; } - +#ifdef __COVERITY__ + /* + * Coverity is dumb, and doesn't realise there + * can only be one thread in this code at a + * time. + */ + pthread_mutex_lock(&pool->mutex); +#endif pool->pending_window = (pool->max_pending > 0) ? pool->max_pending : pool->max; +#ifdef __COVERITY__ + pthread_mutex_unlock(&pool->mutex); +#endif if (pool->min > pool->max) { cf_log_err_cs(cs, "Cannot set 'min' to more than 'max'");