]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: jwt: Missing pkey free during cleanup
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Fri, 4 Feb 2022 13:21:02 +0000 (14:21 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 15 Feb 2022 19:08:20 +0000 (20:08 +0100)
When emptying the jwt_cert_tree during deinit, the entries are freed but
not the EVP_PKEY reference they kept, leading in a memory leak.

Should be backported in 2.5.

src/jwt.c

index 1c13209e01191891454093149409f5616a0d4418..848de99f64c8dbee230fe424bc9371fde77d42d0 100644 (file)
--- a/src/jwt.c
+++ b/src/jwt.c
@@ -364,6 +364,7 @@ static void jwt_deinit(void)
        while (node) {
                entry = ebmb_entry(node, struct jwt_cert_tree_entry, node);
                ebmb_delete(node);
+               EVP_PKEY_free(entry->pkey);
                ha_free(&entry);
                node = ebmb_first(&jwt_cert_tree);
        }