mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Fix a mem leak on error in the PSK code
Thanks to @fangang190 for reporting this issue. Fixes #7060 Reviewed-by: Paul Yang <yang.yang@baishancloud.com> (Merged from https://github.com/openssl/openssl/pull/7065)
This commit is contained in:
parent
307a494e5b
commit
c2cb1a18e0
@ -4621,6 +4621,7 @@ int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
|
||||
if (!s->method->ssl3_enc->generate_master_secret(s,
|
||||
s->session->master_key,pskpms, pskpmslen,
|
||||
&s->session->master_key_length)) {
|
||||
OPENSSL_clear_free(pskpms, pskpmslen);
|
||||
/* SSLfatal() already called */
|
||||
goto err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user