BUILD: pool: Fix GCC error about potential null pointer dereference
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Oct 2023 16:54:29 +0000 (18:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Oct 2023 06:03:02 +0000 (08:03 +0200)
commitb62d5689d2a1cc774414a28c42e939af146a78d4
tree7e6a79488d3e55888f677a28bc9e9f3c9be90ddb
parent90873dc6780dd1ec8a8e0d07799f10cabbe8f423
BUILD: pool: Fix GCC error about potential null pointer dereference

In pool_gc(), GCC 13.2.1 reports an error about a potential null potential
dereference:

src/pool.c: In function ‘pool_gc’:
src/pool.c:807:64: error: potential null pointer dereference [-Werror=null-dereference]
  807 |                         entry->buckets[bucket].free_list = temp->next;
      |                                                            ~~~~^~~~~~

There is no issue here because "bucket" variable cannot be greater than
CONFIG_HAP_POOL_BUCKETS. But to make GCC happy, we now break the loop if it
is greater or equal to CONFIG_HAP_POOL_BUCKETS.
src/pool.c