BUG/MINOR: auth: Fix a leak on error path when parsing user's groups
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 15:52:17 +0000 (16:52 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 14:59:18 +0000 (15:59 +0100)
commit3d92348317da5572078cee1a82c4df174b5be6c0
tree3e0d3e22274a75764dac74674347c204029fab3f
parent4310393f528440948853bfa88f2f39bcbc776aa4
BUG/MINOR: auth: Fix a leak on error path when parsing user's groups

In a userlist section, when a user is parsed, if a specified group is not
found, an error is reported. In this case we must take care to release the
alredy built groups list.

It was reported by Coverity in #2841: CID 1587770.

This patch could be backported to all stable versions.

(cherry picked from commit a7f513af9187444680e3e054e0a13f818aed3307)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 8074bb26d1bbcb225100329ada2498112222e512)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
src/auth.c