]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
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 cf5e5b57941b00794f484680f116e5c1f48faa5b..d3f187def17edd17e27488b843a9e6459454c1dd 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;