summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorx2018 <xkernel.wang@foxmail.com>2021-10-26 11:31:11 +0800
committerTomas Mraz <tomas@openssl.org>2021-10-27 11:07:42 +0200
commit9040cedd52ccbc6aaccdf662249b7ed0b9c677d6 (patch)
tree48a87a839b764f48a19d0650e1bf98c269d8f0e8 /ssl
parent856cd9acdf89756c235aaf5fcec4a4ecd14837c6 (diff)
free the Post-Handshake Auth digest when there is an error saving the digest
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16917) (cherry picked from commit 963eb12dbd551df71d7eb054e095c1b85f4aaab9)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index eef2fe4367..79ac9be04b 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -2381,6 +2381,8 @@ int tls13_save_handshake_digest_for_pha(SSL *s)
if (!EVP_MD_CTX_copy_ex(s->pha_dgst,
s->s3.handshake_dgst)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
+ EVP_MD_CTX_free(s->pha_dgst);
+ s->pha_dgst = NULL;
return 0;
}
}