tls-crypto: Fix potential memory leak
authorTobias Brunner <tobias@strongswan.org>
Tue, 16 Feb 2021 13:50:50 +0000 (14:50 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 16 Feb 2021 13:52:43 +0000 (14:52 +0100)
Fixes: d8e42a3d4e3c ("tls-crypto: Share private key search between client and server")

src/libtls/tls_crypto.c

index cf5e5b5..d3f187d 100644 (file)
@@ -2767,6 +2767,7 @@ enumerator_t *tls_create_private_key_enumerator(tls_version_t min_version,
 
        if (!array_count(enumerator->key_types))
        {
+               private_key_destroy(enumerator);
                return NULL;
        }
        return &enumerator->public;