mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 23:21:04 +00: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
|
= Branch 1.2
|
||||||
Bugfix
|
Bugfix
|
||||||
|
* Fixed potential memory leak when failing to resume a session
|
||||||
* Minor fixes
|
* Minor fixes
|
||||||
|
|
||||||
Security
|
Security
|
||||||
|
|
|
@ -2345,6 +2345,13 @@ int ssl_parse_certificate( ssl_context *ssl )
|
||||||
return( POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE );
|
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(
|
if( ( ssl->session_negotiate->peer_cert = (x509_cert *) malloc(
|
||||||
sizeof( x509_cert ) ) ) == NULL )
|
sizeof( x509_cert ) ) ) == NULL )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue