summaryrefslogtreecommitdiff
path: root/src/benchmark-cipher.c
diff options
context:
space:
mode:
authorSUMIT AGGARWAL <aggarwal.s@samsung.com>2016-08-19 11:58:39 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-22 11:25:44 +0200
commit39cdaed454b12c7be9881d550ec2ea89c649c707 (patch)
treed0c8a25316d560928489feb53bf80c11cb7ab510 /src/benchmark-cipher.c
parent12f5166d46db1459455b33b32c01b1fde5c73701 (diff)
downloadgnutls-39cdaed454b12c7be9881d550ec2ea89c649c707.tar.gz
Fix HANDLE_LEAK and memory leak issues.
Diffstat (limited to 'src/benchmark-cipher.c')
-rw-r--r--src/benchmark-cipher.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c
index 636ab2a1ce..15ae615062 100644
--- a/src/benchmark-cipher.c
+++ b/src/benchmark-cipher.c
@@ -66,8 +66,11 @@ static void cipher_mac_bench(int algo, int mac_algo, int size)
memset(_key, 0xf0, keysize);
_iv = malloc(ivsize);
- if (_iv == NULL)
+ if (_iv == NULL) {
+ if (_key)
+ free(_key);
return;
+ }
memset(_iv, 0xf0, ivsize);
iv.data = _iv;