Remove references to malloc in strings/names
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 25a5d00..ec2b346 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -1154,7 +1154,7 @@
ssl->handshake->verify_cookie = mbedtls_calloc( 1, cookie_len );
if( ssl->handshake->verify_cookie == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc failed (%d bytes)", cookie_len ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc failed (%d bytes)", cookie_len ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
@@ -2913,7 +2913,7 @@
if( ( ticket = mbedtls_calloc( 1, ticket_len ) ) == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "ticket malloc failed" ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "ticket alloc failed" ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index e353829..fa4d39e 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -932,7 +932,7 @@
ssl->compress_buf = mbedtls_calloc( 1, MBEDTLS_SSL_BUFFER_LEN );
if( ssl->compress_buf == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed",
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed",
MBEDTLS_SSL_BUFFER_LEN ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
@@ -2456,14 +2456,14 @@
/* Allocate space for current message */
if( ( msg = mbedtls_calloc( 1, sizeof( mbedtls_ssl_flight_item ) ) ) == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc %d bytes failed",
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc %d bytes failed",
sizeof( mbedtls_ssl_flight_item ) ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
if( ( msg->p = mbedtls_calloc( 1, ssl->out_msglen ) ) == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc %d bytes failed", ssl->out_msglen ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc %d bytes failed", ssl->out_msglen ) );
mbedtls_free( msg );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
@@ -2927,7 +2927,7 @@
ssl->handshake->hs_msg = mbedtls_calloc( 1, alloc_len );
if( ssl->handshake->hs_msg == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc failed (%d bytes)", alloc_len ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc failed (%d bytes)", alloc_len ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
@@ -3978,7 +3978,7 @@
if( ( ssl->session_negotiate->peer_cert = mbedtls_calloc( 1,
sizeof( mbedtls_x509_crt ) ) ) == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed",
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed",
sizeof( mbedtls_x509_crt ) ) );
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
}
@@ -4916,7 +4916,7 @@
ssl->transform_negotiate == NULL ||
ssl->session_negotiate == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc() of ssl sub-contexts failed" ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc() of ssl sub-contexts failed" ) );
mbedtls_free( ssl->handshake );
mbedtls_free( ssl->transform_negotiate );
@@ -5005,7 +5005,7 @@
if( ( ssl-> in_buf = mbedtls_calloc( 1, len ) ) == NULL ||
( ssl->out_buf = mbedtls_calloc( 1, len ) ) == NULL )
{
- MBEDTLS_SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", len ) );
+ MBEDTLS_SSL_DEBUG_MSG( 1, ( "alloc(%d bytes) failed", len ) );
mbedtls_free( ssl->in_buf );
ssl->in_buf = NULL;
return( MBEDTLS_ERR_SSL_MALLOC_FAILED );
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index ca08f54..6262d33 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -87,7 +87,7 @@
#define MEM_BLOCK_OVERHEAD ( 2 * sizeof( size_t ) )
/*
- * Size to use for the malloc buffer if MEMORY_BUFFER_ALLOC_C is defined.
+ * Size to use for the alloc buffer if MEMORY_BUFFER_ALLOC_C is defined.
*/
#define HEAP_SIZE (1u << 16) // 64k
@@ -253,7 +253,7 @@
char title[TITLE_LEN];
todo_list todo;
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
- unsigned char malloc_buf[HEAP_SIZE] = { 0 };
+ unsigned char alloc_buf[HEAP_SIZE] = { 0 };
#endif
if( argc <= 1 )
@@ -319,7 +319,7 @@
mbedtls_printf( "\n" );
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
- mbedtls_memory_buffer_alloc_init( malloc_buf, sizeof( malloc_buf ) );
+ mbedtls_memory_buffer_alloc_init( alloc_buf, sizeof( alloc_buf ) );
#endif
memset( buf, 0xAA, sizeof( buf ) );
memset( tmp, 0xBB, sizeof( tmp ) );