BUG/MINOR: ssl/cli: fix a lock leak when no memory available
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 4 May 2021 14:17:27 +0000 (16:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 May 2021 05:56:36 +0000 (07:56 +0200)
commitf41d4db9d04f88e7202fd2f21f4791d4f2eb3414
treebc3c6912e2302cb51fd3a742409ed206a420cd6d
parentbfca73774afea9091d4902af66ed05a36a50f137
BUG/MINOR: ssl/cli: fix a lock leak when no memory available

This bug was introduced in e5ff4ad ("BUG/MINOR: ssl: fix a trash buffer
leak in some error cases").

When cli_parse_set_cert() returns because alloc_trash_chunk() failed, it
does not unlock the spinlock which can lead to a deadlock later.

Must be backported as far as 2.1 where e5ff4ad was backported.

(cherry picked from commit 5ba80d677d563517bb9754c272e6df94adae281b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/ssl_ckch.c