]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CID 1400058: Dumb false positive
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 30 May 2017 00:39:32 +0000 (20:39 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 30 May 2017 00:39:32 +0000 (20:39 -0400)
src/main/connection.c

index 5eeea0afe05a94731385bb06a833f69dd410e6b4..077e694a583aa6f1792e7761876f5a950c6c09e4 100644 (file)
@@ -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'");