mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 22:55:38 +01:00
Fixed potential memory leak when failing to resume a session
This commit is contained in:
parent
78020fe72c
commit
a565aceea1
@ -2,6 +2,7 @@ PolarSSL ChangeLog
|
||||
|
||||
= Branch 1.2
|
||||
Bugfix
|
||||
* Fixed potential memory leak when failing to resume a session
|
||||
* Minor fixes
|
||||
|
||||
Security
|
||||
|
@ -2345,6 +2345,13 @@ int ssl_parse_certificate( ssl_context *ssl )
|
||||
return( POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE );
|
||||
}
|
||||
|
||||
/* In case we tried to reuse a session but it failed */
|
||||
if( ssl->session_negotiate->peer_cert != NULL )
|
||||
{
|
||||
x509_free( ssl->session_negotiate->peer_cert );
|
||||
free( ssl->session_negotiate->peer_cert );
|
||||
}
|
||||
|
||||
if( ( ssl->session_negotiate->peer_cert = (x509_cert *) malloc(
|
||||
sizeof( x509_cert ) ) ) == NULL )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user