mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 08:45:34 +00:00
ssl_server2: add buffer overhead for a termination character
Switch to mbedtls style of memory allocation
This commit is contained in:
parent
d731a6348a
commit
216b40de9b
|
@ -1355,7 +1355,7 @@ int main( int argc, char *argv[] )
|
||||||
#if defined(MBEDTLS_DEBUG_C)
|
#if defined(MBEDTLS_DEBUG_C)
|
||||||
mbedtls_debug_set_threshold( opt.debug_level );
|
mbedtls_debug_set_threshold( opt.debug_level );
|
||||||
#endif
|
#endif
|
||||||
buf = malloc( opt.buffer_size );
|
buf = mbedtls_calloc( 1, opt.buffer_size + 1 );
|
||||||
if( buf == NULL )
|
if( buf == NULL )
|
||||||
{
|
{
|
||||||
mbedtls_printf("Could not allocate %u bytes\n", opt.buffer_size);
|
mbedtls_printf("Could not allocate %u bytes\n", opt.buffer_size);
|
||||||
|
@ -2545,6 +2545,7 @@ exit:
|
||||||
mbedtls_memory_buffer_alloc_free();
|
mbedtls_memory_buffer_alloc_free();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mbedtls_free(buf);
|
||||||
mbedtls_printf( " done.\n" );
|
mbedtls_printf( " done.\n" );
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
Loading…
Reference in a new issue