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.

(cherry picked from commit e2ef4dd3c579869d223534f3108a405774b351aa)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e9c976dea1571330f238ffcfe50b337432342118)
[cf: adapted because of applet changes in 2.6]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a382e88741e611c2b90865b418e3122db2fc5f27)
[cf: ssl.path is removed from the appctx context. In 2.5, it is performed in
     another patch, not backported in 2.4.]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
2 files changed