]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: stick-table: release server_key on any stksess destruction
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 12 Nov 2026 17:05:08 +0000 (18:05 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 12 Nov 2026 17:07:52 +0000 (18:07 +0100)
commitbe0aa0f5c3244d84135aae700f56df80a93747f1
tree6db7a984d11b39e90a3a27e98e6802f18ba9308d
parentf12c7c7d9f0d0b7880d021924d2f056d1303fe05
BUG/MINOR: stick-table: release server_key on any stksess destruction

A stick-table storing server_key holds a reference on a dictionary entry
for each of its entries. This reference is released by stksess_free()
only, while expiry (process_table_expire()), eviction
(stktable_trash_oldest()) and explicit deletion (__stksess_kill(), also
used by "clear table") destroy the session through __stksess_free()
directly. The dictionary entry is then never freed: it stays in
server_key_dict with a refcount of 1 and no owner, and memory grows
linearly with the number of distinct values that went through the table.

Move the release into __stksess_free() so that every destruction path
releases it, and leave stksess_free() as a simple wrapper.

This must be backported to all stable versions.
src/stick_table.c