BUG/MINOR: stick-table: don't deinit the buckets of a never initialized table
stktable_init() is skipped for the table of a disabled proxy, so its
buckets' in_bucket_toadd lists are never initialized. stktable_deinit()
still calls MT_LIST_DELETE() on them when the proxy is freed, and
mt_list_delete() dereferences their NULL pointers. As a result, a config
with a disabled backend declaring a stick-table segfaults at the end of
"haproxy -c" (exit 139) and on every graceful stop, so on every reload.
Only walk the buckets once the table was initialized, which t->pool
tells. The rest of the function is already safe on a never initialized
table.
This was introduced with the per-bucket expiration tasks in commit
8bc8a21b2 ("MEDIUM: stick-tables: Use a per-shard expiration task"),
3.3-dev11, so it must be backported to 3.3.
It should fix the issue #3581.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>