diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2019-02-20 00:00:14 +0100 |
---|---|---|
committer | Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> | 2019-02-20 10:33:51 +0100 |
commit | ce73eefb21ffc7e4d8f7171694b034b3b1644fc6 (patch) | |
tree | 848e0bab3fa66bec806848a6bca339b8f5ca940f /test | |
parent | b0986cb9e74beb01ea32d16761515b4d4f91ea09 (diff) | |
download | tpm2-tss-ce73eefb21ffc7e4d8f7171694b034b3b1644fc6.tar.gz |
test: cleanup hmac and hash contexts
If we do not clean up the 'invalid' contexts valgrind complains about memory leaks - also tests often serve as reference code.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/esys-crypto.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/esys-crypto.c b/test/unit/esys-crypto.c index 7fcc95a4..34023df0 100644 --- a/test/unit/esys-crypto.c +++ b/test/unit/esys-crypto.c @@ -72,6 +72,9 @@ check_hash_functions(void **state) rc = iesys_crypto_hash_finish(&context, &buffer[0], &size); assert_int_equal (rc, TSS2_ESYS_RC_BAD_REFERENCE); + + /* cleanup */ + iesys_crypto_hmac_abort(&context); } static void @@ -126,6 +129,9 @@ check_hmac_functions(void **state) rc = iesys_crypto_hmac_finish(&context, &buffer[0], &size); assert_int_equal (rc, TSS2_ESYS_RC_BAD_REFERENCE); + + /* cleanup */ + iesys_crypto_hash_abort(&context); } static void |