diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 709f23068..41722e8fd 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -3066,6 +3066,11 @@ int ssl_init( ssl_context *ssl ) ssl->min_minor_ver = SSL_MINOR_VERSION_0; ssl->ciphersuites = malloc( sizeof(int *) * 4 ); + if( ssl->ciphersuites == NULL ) + { + SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", sizeof(int *) * 4) ); + return( POLARSSL_ERR_SSL_MALLOC_FAILED ); + } ssl_set_ciphersuites( ssl, ssl_default_ciphersuites ); #if defined(POLARSSL_DHM_C)