]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 31 May 2022 16:07:59 +0000 (18:07 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 14:28:15 +0000 (16:28 +0200)
commite2ef4dd3c579869d223534f3108a405774b351aa
tree1f3587be2ddf18d98009fdac9d274b061a9bd604
parent1f08fa46fb5c2ec02f740b716a9674dc72a5cadc
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a cert entry

When a certificate entry is replaced (via 'set ssl cert' command), the path
is duplicated and used to identify the ongoing transaction. However, if the
same command is repeated, the path is still duplicated but the transaction
is not changed and the duplicated path is not released. Thus there is a
memory leak.

By reviewing the code, it appears there is no reason to duplicate the
path. It is always the path of the old entry. So, a reference on it is now
used. This simplifies the code and this fixes the memory leak.

This patch must be backported as far as 2.2.
src/ssl_ckch.c