]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pacify Coverity (CID #1680659 and #1680658) developer/ndptech master
authorNick Porter <nick@portercomputing.co.uk>
Tue, 27 Jan 2026 10:23:48 +0000 (10:23 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 27 Jan 2026 10:24:56 +0000 (10:24 +0000)
Coverity doesn't appear to look inside state_entry_create to see that it
leaves the mutex unlocked on failure.

src/lib/server/state.c

index 68f3b016244739c912af10752cc409cea84d7e2b..ccdb6204107376df20643bcc8da351c1b775d9ce 100644 (file)
@@ -868,6 +868,14 @@ int fr_state_store(fr_state_tree_t *state, request_t *request)
        if (!entry) {
                talloc_free(request_state_replace(request, state_ctx));
                request_data_restore(request, &data);   /* Put it back again */
+
+#ifdef __COVERITY__
+               /*
+                *  Coverity doesn't see that state_entry_create releases
+                *  the lock on failure
+                */
+               PTHREAD_MUTEX_UNLOCK(&state->mutex)
+#endif
                return -1;
        }