mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Fix memory leaks in CMAC tests
This commit is contained in:
parent
8abc6b86f9
commit
d444358247
2 changed files with 15 additions and 8 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue