]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: tools: fix memory leak in indent_msg() on out of memory
authorWilly Tarreau <w@1wt.eu>
Sun, 26 Apr 2026 21:00:57 +0000 (23:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 27 Apr 2026 12:44:29 +0000 (14:44 +0200)
commitd5efce7a130222385564bb5cda925f027539a9df
tree1a881763d28607d24d76257463a9a7b68294c051
parent84cb8dd1263c8c5fe1a4f82a8fbb858f9493c88e
BUG/MINOR: tools: fix memory leak in indent_msg() on out of memory

When malloc() fails in indent_msg, the function returned NULL without
freeing the original *out string as it was supposed to. The caller loses
both the original string (leaked) and gets NULL back. Fixed to free *out
and set it to NULL before returning.
src/tools.c