1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Fix memory leaks in CMAC tests

This commit is contained in:
Janos Follath
2016-10-12 10:00:42 +01:00
parent 8abc6b86f9
commit d444358247
2 changed files with 15 additions and 8 deletions

View File

@ -93,7 +93,6 @@ void mbedtls_cmac_null_args( )
NULL ) ==
MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA );
exit:
mbedtls_cipher_free( &ctx );
}
@ -114,6 +113,7 @@ void mbedtls_cmac_setkey( int cipher_type, int key_size,
TEST_ASSERT( ( cipher_info = mbedtls_cipher_info_from_type( cipher_type ) )
!= NULL );
memset( buf, 0x2A, sizeof( buf ) );
TEST_ASSERT( ( result == mbedtls_cipher_cmac( cipher_info, key, key_size,
buf, 16, tmp ) ) != 0 );
}