mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 12:05:36 +01: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
|
* Prepare base structures
|
||||||
*/
|
*/
|
||||||
ssl->in_buf = polarssl_malloc( len );
|
if( ( ssl->in_buf = polarssl_malloc( len ) ) == NULL ||
|
||||||
ssl->out_buf = polarssl_malloc( len );
|
( ssl->out_buf = polarssl_malloc( len ) ) == NULL )
|
||||||
|
|
||||||
if( ssl->in_buf == NULL || ssl->out_buf == NULL )
|
|
||||||
{
|
{
|
||||||
SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", len ) );
|
SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", len ) );
|
||||||
polarssl_free( ssl->in_buf );
|
polarssl_free( ssl->in_buf );
|
||||||
polarssl_free( ssl->out_buf );
|
|
||||||
ssl->in_buf = NULL;
|
ssl->in_buf = NULL;
|
||||||
ssl->out_buf = NULL;
|
|
||||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user