#3474·haproxy

CID 1685240: src/cache.c: dead code suspected by coverity

Author: chipitsineCreated Aug 13, 2026Updated Aug 14, 2026
Labelstype: code-report

Tool Name and Version

coverity

Code Report

plain
2676                /* In case of Vary, we could have multiple entries with the same
2677                 * primary hash. We need to calculate the secondary hash in order
2678                 * to find the actual entry we want (if it exists). */
2679                if (res && res->secondary_key_signature) {
2680                        if (!http_request_build_secondary_key(s, res->secondary_key_signature)) {
2681                                struct cache_entry *to_release = NULL;
2682                                struct shared_block *to_reattach = NULL;
2683
2684                                cache_rdlock(cache_tree);
2685                                sec_entry = get_secondary_entry(cache_tree, res,
2686                                                                s->txn.http->cache_hash,
2687                                                                s->txn.http->cache_secondary_hash,
2688                                                                0);
2689                                if (!sec_entry) {
2690                                        /* Secondary key miss: the retained primary entry
2691                                         * has to be released and its row handed back, but
2692                                         * not from here, see below.
2693                                         */
2694                                        to_release = res;
      	const: At condition detached, the value of detached must be equal to 1.
      	dead_error_condition: The condition detached must be true.
      	
CID 1685240: (#2 of 2): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression NULL inside this statement: to_reattach = (detached ? b....
2695                                        to_reattach = detached ? block_ptr(res) : NULL;
2696                                }

Additional Information

No response

Output of haproxy -vv

plain
n/a