]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cli: Fix memory leak on error for _getsocks command
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 14:30:30 +0000 (15:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 14:43:04 +0000 (15:43 +0100)
commit372cc696d44e6853b9f7920f1c2d965736029764
tree00dd1b7c3a49469a152ae58a84820f84b10d451b
parent7e927243b9e86cee13ea9c16077a8523e79e41bb
BUG/MINOR: cli: Fix memory leak on error for _getsocks command

Some errors in parse function of _getsocks commands were not properly handled
and immediately returned, leading to a memory leak on cmsgbuf and tmpbuf
buffers.

To fix the issue, instead of immediately return with -1, we jump to "out"
label. Returning 1 intead of -1 in that case is valid.

This was reported by Coverity in #2841: CIDs 1587773 and 1587772.

This patch should be backported as far as 2.4.
src/cli.c