mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-27 06:41:08 +00:00
test_suite_ssl: prefer ASSERT_ALLOC over malloc
Fix formatting for option initialization Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
2e1a232261
commit
3d0d501517
@ -122,8 +122,10 @@ void init_handshake_options( handshake_test_options *opts )
|
|||||||
opts->cli_log_fun = NULL;
|
opts->cli_log_fun = NULL;
|
||||||
opts->resize_buffers = 1;
|
opts->resize_buffers = 1;
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||||
opts->cache = malloc( sizeof( mbedtls_ssl_cache_context ) );
|
ASSERT_ALLOC( opts->cache, sizeof( mbedtls_ssl_cache_context ) );
|
||||||
mbedtls_ssl_cache_init( opts->cache );
|
mbedtls_ssl_cache_init( opts->cache );
|
||||||
|
exit:
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +133,7 @@ void free_handshake_options( handshake_test_options *opts )
|
|||||||
{
|
{
|
||||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||||
mbedtls_ssl_cache_free( opts->cache );
|
mbedtls_ssl_cache_free( opts->cache );
|
||||||
free( opts->cache );
|
mbedtls_free( opts->cache );
|
||||||
#else
|
#else
|
||||||
(void) opts;
|
(void) opts;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user