]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a memory leak in tls_parse_stoc_key_share
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 3 Nov 2021 08:40:59 +0000 (09:40 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 4 Nov 2021 15:50:42 +0000 (16:50 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16957)

ssl/statem/extensions_clnt.c

index ce8a75794c3ad9cdd4bb7b2ec1acb53ce82b3df0..621fcfa561d5c400ab270d40eaea4a0a20757bee 100644 (file)
@@ -1872,6 +1872,7 @@ int tls_parse_stoc_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
     if (skey == NULL || EVP_PKEY_copy_parameters(skey, ckey) <= 0) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PARSE_STOC_KEY_SHARE,
                  ERR_R_MALLOC_FAILURE);
+        EVP_PKEY_free(skey);
         return 0;
     }
     if (!EVP_PKEY_set1_tls_encodedpoint(skey, PACKET_data(&encoded_pt),