ssl_server2: add buffer overhead for a termination character
Switch to mbedtls style of memory allocation
This commit is contained in:
parent
c19fc55538
commit
da4029d665
@ -1724,7 +1724,7 @@ int main( int argc, char *argv[] )
|
||||
#if defined(MBEDTLS_DEBUG_C)
|
||||
mbedtls_debug_set_threshold( opt.debug_level );
|
||||
#endif
|
||||
buf = malloc( opt.buffer_size );
|
||||
buf = mbedtls_calloc( 1, opt.buffer_size + 1 );
|
||||
if( buf == NULL )
|
||||
{
|
||||
mbedtls_printf("Could not allocate %u bytes\n", opt.buffer_size);
|
||||
@ -3116,6 +3116,7 @@ exit:
|
||||
mbedtls_memory_buffer_alloc_free();
|
||||
#endif
|
||||
|
||||
mbedtls_free(buf);
|
||||
mbedtls_printf( " done.\n" );
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
Loading…
Reference in New Issue
Block a user