]> 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:45:04 +0000 (16:45 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16956)

ssl/statem/extensions_clnt.c

index 78cc226064030be4ef8bb485032372c473ec29bc..b38c9ca68429cc4e81f93c03f4ff346ee3f2a82e 100644 (file)
@@ -1830,6 +1830,7 @@ int tls_parse_stoc_key_share(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
         skey = EVP_PKEY_new();
         if (skey == NULL || EVP_PKEY_copy_parameters(skey, ckey) <= 0) {
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_COPY_PARAMETERS_FAILED);
+            EVP_PKEY_free(skey);
             return 0;
         }