]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 31 May 2022 16:10:19 +0000 (18:10 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 14:28:15 +0000 (16:28 +0200)
commit1e00c7e8f4c7df83c9a4610d1a39d3d24f82ec0c
tree39909a9c678e63a154cc40996a2922e197c815e4
parente2ef4dd3c579869d223534f3108a405774b351aa
BUG/MINOR: ssl_ckch: Don't duplicate path when replacing a CA/CRL entry

When a CA or CRL entry is replaced (via 'set ssl ca-file' or 'set ssl
crl-file' commands), 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 filename 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.5.
src/ssl_ckch.c