mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-09 23:25:38 +00:00
Fixed potential memory leak when failing to resume a session
Conflicts: ChangeLog library/ssl_tls.c
This commit is contained in:
parent
16e5f81473
commit
df177ba728
|
@ -1,6 +1,9 @@
|
|||
PolarSSL ChangeLog
|
||||
|
||||
= Branch 1.1
|
||||
Bugfix
|
||||
* Fixed potential memory leak when failing to resume a session
|
||||
|
||||
Security
|
||||
* Potential buffer-overflow for ssl_read_record() (independently found by
|
||||
both TrustInSoft and Paul Brodeur of Leviathan Security Group)
|
||||
|
|
|
@ -1444,6 +1444,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->peer_cert != NULL )
|
||||
{
|
||||
x509_free( ssl->peer_cert );
|
||||
free( ssl->peer_cert );
|
||||
}
|
||||
|
||||
if( ( ssl->peer_cert = (x509_cert *) malloc(
|
||||
sizeof( x509_cert ) ) ) == NULL )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue