]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: haload: fix hld_new_usr()'s error path
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 26 Aug 2026 11:57:00 +0000 (13:57 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Wed, 26 Aug 2026 16:16:35 +0000 (18:16 +0200)
commit409b7924390c7be5b67d7e0736b32be578ae5e5d
tree3f571590531716aad522427befc4e88417afa0fc
parent695309acee64f914d743a4bada8c0076cf34657f
BUG/MINOR: haload: fix hld_new_usr()'s error path

When <usr>, <t>, or <sess> failed to allocate, the error path always
dereferenced ->urls, even when <usr> itself hadn't been allocated
yet. It also never freed <sess> on any failure, leaking it.

<usr> is now only allocated once <t> and <sess> are confirmed valid,
so ->urls is only ever touched once <usr> is fully set up. The error
path frees <sess> too, on every failure.
src/haload.c