]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: log: fix double-free error when error in parse_loger occurs
authorKirill Furman <kir.furman@gmail.com>
Fri, 14 Aug 2026 13:10:02 +0000 (16:10 +0300)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Aug 2026 15:10:13 +0000 (17:10 +0200)
commit9204caf5452120de41d57bae0430b5240d63d4a9
tree3b4ad6c4367a1200ca72500608a0f5737c0eddc5
parentc5f41118c01db4babcf6919f5eae4ce308adcfef
BUG/MINOR: log: fix double-free error when error in parse_loger occurs

Passing incorrect argments in parse_logger() which contains sample and
some values, value of logger->lb.smp_rgs will equal to smp_rgs and then,
if goto error: occurs we firstly free(smp_rgs) and after it
free(logger->lb.smp_rgs) inside free_logger() function causes double-free.
It has been reported in GH #3458

Fix it by checking the value of logger->lb.smp_rgs inside error:
statement in parse_logger(), if it equal to smp_rgs - just assign
NULL to logger->lb.smp_rgs.

This fix should be backported to versions 2.6 and upper.
src/log.c