diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2015-02-18 10:39:49 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2015-02-18 10:39:49 +0000 |
commit | 4e41c99ed88505819574506a4d3b0b918f70dbf2 (patch) | |
tree | 61c82c0311487b336b8ee7af24ebc4e90b8a9765 | |
parent | cd4cd1dd2671f991888d9dde7d2d402f7051db64 (diff) | |
parent | f7db5e0a4a8b1de5154e154ec2097ae867fd7380 (diff) | |
download | mbedtls-archive/mbedtls-1.4.zip mbedtls-archive/mbedtls-1.4.tar.gz mbedtls-archive/mbedtls-1.4.tar.bz2 |
Merge branch 'development' into dtlsarchive/mbedtls-1.4
* development:
Avoid possible dangling pointers
Conflicts:
library/ssl_tls.c
-rw-r--r-- | library/ssl_tls.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 052a198..b09ee53 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -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 ); } |