]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: fix potential memory leak upon error in add_to_logformat_list()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 4 Sep 2025 08:26:37 +0000 (10:26 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 4 Sep 2025 21:07:22 +0000 (23:07 +0200)
commitc97ced3f938271c9d648594d6c4bfcd194c36a7d
tree0d03c9f1831f0d8af2a041066d267ee2d510ec48
parent842f32f3f1beb332e5c8ff46aa6e91c23b3cb8fc
BUG/MINOR: log: fix potential memory leak upon error in add_to_logformat_list()

As reported on GH #3099, upon memory error add_to_logformat_list() will
return and error but it fails to properly memory which was allocated
within the function, which could result in memory leak.

Let's free all relevant variables allocated by the function before returning.

No backport needed unless 22ac1f5ee ("("BUG/MINOR: log: Add OOM checks for
calloc() and malloc() in logformat parser and dup_logger()") is.
src/log.c