mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 00:05:35 +00:00
Merge branch 'development' into dtls
* development: Avoid possible dangling pointers Conflicts: library/ssl_tls.c
This commit is contained in:
commit
4e41c99ed8
|
@ -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