aboutsummaryrefslogtreecommitdiffstats
path: root/test/hmactest.c
diff options
context:
space:
mode:
authorRussell Webb <russell.webb@intel.com>2015-06-13 10:35:55 -0400
committerRich Salz <rsalz@openssl.org>2015-06-23 07:59:15 -0400
commit2d540402aac7a05af9c99b58864d53c0201a0b42 (patch)
tree0099f9017d00969fa9a09a4c8a0d7aa990e42ec9 /test/hmactest.c
parenta1c506ae9ecb493bb1ae3226100b489e56c4d307 (diff)
downloadopenssl-2d540402aac7a05af9c99b58864d53c0201a0b42.tar.gz
RT3856: Fix memory leaks in test code
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'test/hmactest.c')
-rw-r--r--test/hmactest.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/hmactest.c b/test/hmactest.c
index a9b829d078..f8d535063f 100644
--- a/test/hmactest.c
+++ b/test/hmactest.c
@@ -188,6 +188,7 @@ int main(int argc, char *argv[])
}
printf("test 4 ok\n");
test5:
+ HMAC_CTX_cleanup(&ctx);
HMAC_CTX_init(&ctx);
if (HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, NULL, NULL)) {
printf("Should fail to initialise HMAC with empty MD (test 5)\n");
@@ -277,6 +278,7 @@ test5:
printf("test 5 ok\n");
}
test6:
+ HMAC_CTX_cleanup(&ctx);
HMAC_CTX_init(&ctx);
if (!HMAC_Init_ex(&ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) {
printf("Failed to initialise HMAC (test 6)\n");
@@ -307,6 +309,7 @@ test6:
printf("test 6 ok\n");
}
end:
+ HMAC_CTX_cleanup(&ctx);
EXIT(err);
}