aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/statem
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2021-11-03 09:40:59 +0100
committerBernd Edlinger <bernd.edlinger@hotmail.de>2021-11-04 16:45:04 +0100
commitb3c34401c088dc247b8b54ea812e7cdde6caf361 (patch)
treea38923393a679bcc34719bde8cd7553d08c23ef7 /ssl/statem
parent3841d0f6f02e1ad3a54beabf1d5395bd1c383254 (diff)
downloadopenssl-b3c34401c088dc247b8b54ea812e7cdde6caf361.tar.gz
Fix a memory leak in tls_parse_stoc_key_share
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16956)
Diffstat (limited to 'ssl/statem')
-rw-r--r--ssl/statem/extensions_clnt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
index 78cc226064..b38c9ca684 100644
--- a/ssl/statem/extensions_clnt.c
+++ b/ssl/statem/extensions_clnt.c
@@ -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;
}