mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-02 18:46:06 +02:00
Fix mbedtls_test_free_handshake_options
We usually follow the pattern that a zero-initialised struct is safe to free. This wasn't the case here. Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
@@ -99,8 +99,10 @@ void mbedtls_test_free_handshake_options(
|
||||
mbedtls_test_handshake_test_options *opts)
|
||||
{
|
||||
#if defined(MBEDTLS_SSL_CACHE_C)
|
||||
mbedtls_ssl_cache_free(opts->cache);
|
||||
mbedtls_free(opts->cache);
|
||||
if (opts->cache != NULL) {
|
||||
mbedtls_ssl_cache_free(opts->cache);
|
||||
mbedtls_free(opts->cache);
|
||||
}
|
||||
#else
|
||||
(void) opts;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user