]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: pools: simplify the pool expression when no pool was matched in dump
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Sep 2023 11:31:41 +0000 (13:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Sep 2023 11:31:41 +0000 (13:31 +0200)
When dumping pool information, we make a special case of the condition
where the pool couldn't be identified and we consider that it was the
correct one. In the code arrangements brought by commit efc46dede ("DEBUG:
pools: inspect pools on fatal error and dump information found"), a
ternary expression for testing this depends on the "if" block condition
so this can be simplified and will make Coverity happy. This was reported
in GH #2290.

src/pool.c

index 058c4454050c32cf5430dd9b736762686107f799..2f20fd55537ed9c9f7328e177f9831ca5631405c 100644 (file)
@@ -1055,7 +1055,7 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item
                        /* the pool couldn't be formally verified */
                        chunk_appendf(&trash, "Other possible callers:\n");
                        list_for_each_entry(ph, &pools, list) {
-                               if (ph == (the_pool ? the_pool : pool))
+                               if (ph == pool)
                                        continue;
                                pool_mark = (const void **)(((char *)item) + ph->alloc_sz - sizeof(void*));
                                if (!may_access(pool_mark))