]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: leak of ckch_inst_link in ckch_inst_free()
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 29 Aug 2022 16:53:34 +0000 (18:53 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 29 Aug 2022 16:53:34 +0000 (18:53 +0200)
ckch_inst_free() unlink the ckch_inst_link structure but never free it.
It can cause a memory leak upon a ckch_inst_free() done with CLI
operation.

Bug introduced by commit 4458b97 ("MEDIUM: ssl: Chain ckch instances in
ca-file entries").

Must be backported as far as 2.5.

src/ssl_ckch.c

index 6db62e193c115e380b9b6e00884092d6ddf7d125..2feb769ca653671c1c9456a8107614162eb3668e 100644 (file)
@@ -989,6 +989,7 @@ void ckch_inst_free(struct ckch_inst *inst)
        list_for_each_entry_safe(link_ref, link_ref_s, &inst->cafile_link_refs, list) {
                LIST_DELETE(&link_ref->link->list);
                LIST_DELETE(&link_ref->list);
+               free(link_ref->link);
                free(link_ref);
        }