BUG/MINOR: ssl: Add missing free on SSL_CTX in ckch_inst_free
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 31 Mar 2021 09:49:27 +0000 (11:49 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 31 Mar 2021 10:41:23 +0000 (12:41 +0200)
The ckch instance keeps a reference to its SSL_CTX since commit 358a822
("BUG/MINOR: ssl: Fix update of default certificate") but this instance
was not freed during the instance's deletion.

It can be backported as far as 2.2 and where 358a822 is backported.

src/ssl_ckch.c

index eeaa416..49f585d 100644 (file)
@@ -913,6 +913,8 @@ void ckch_inst_free(struct ckch_inst *inst)
                ebmb_delete(&sni->name);
                free(sni);
        }
+       SSL_CTX_free(inst->ctx);
+       inst->ctx = NULL;
        LIST_DEL(&inst->by_ckchs);
        LIST_DEL(&inst->by_crtlist_entry);
        free(inst);