]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: fix ssl_bind_conf double free w/ wildcards
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 26 Aug 2020 15:34:44 +0000 (17:34 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 26 Aug 2020 15:39:23 +0000 (17:39 +0200)
The fix 7df5c2d ("BUG/MEDIUM: ssl: fix ssl_bind_conf double free") was
not complete. The problem still occurs when using wildcards in
certificate, during the deinit.

This patch removes the free of the ssl_conf structure in
ssl_sock_free_all_ctx() since it's already done in the crtlist deinit.

It must be backported in 2.2.

src/ssl_sock.c

index 6e6f337ffe8b1e9f2624aab2bf6fa7e830cbd0e4..64208daef5c3f5d2faa718dfec5b874d6c6c0bb3 100644 (file)
@@ -5040,11 +5040,6 @@ void ssl_sock_free_all_ctx(struct bind_conf *bind_conf)
                back = ebmb_next(node);
                ebmb_delete(node);
                SSL_CTX_free(sni->ctx);
-               if (!sni->order) { /* only free the SSL conf its first occurrence */
-                       ssl_sock_free_ssl_conf(sni->conf);
-                       free(sni->conf);
-                       sni->conf = NULL;
-               }
                LIST_DEL(&sni->by_ckch_inst);
                free(sni);
                node = back;