mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-25 02:18:08 +00:00
Merge branch 'development' into dtls
* development: Avoid possible dangling pointers Conflicts: library/ssl_tls.c
This commit is contained in:
commit
4e41c99ed8
1 changed files with 2 additions and 6 deletions
|
@ -4925,16 +4925,12 @@ int ssl_init( ssl_context *ssl )
|
|||
/*
|
||||
* Prepare base structures
|
||||
*/
|
||||
ssl->in_buf = polarssl_malloc( len );
|
||||
ssl->out_buf = polarssl_malloc( len );
|
||||
|
||||
if( ssl->in_buf == NULL || ssl->out_buf == NULL )
|
||||
if( ( ssl->in_buf = polarssl_malloc( len ) ) == NULL ||
|
||||
( ssl->out_buf = polarssl_malloc( len ) ) == NULL )
|
||||
{
|
||||
SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", len ) );
|
||||
polarssl_free( ssl->in_buf );
|
||||
polarssl_free( ssl->out_buf );
|
||||
ssl->in_buf = NULL;
|
||||
ssl->out_buf = NULL;
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue