aboutsummaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-11-28 14:40:11 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-11-28 14:40:11 +0100
commitd1d3beac330d301440ea64c463933aa9950c7df1 (patch)
treea3cac3b92a2faeaff2d87d9487d8d6372f2c097c /tests/unittests
parentad0abff8b3bffafadceeb9815f4bf1b63e10b5c4 (diff)
downloadlibssh-d1d3beac330d301440ea64c463933aa9950c7df1.tar.gz
libssh-d1d3beac330d301440ea64c463933aa9950c7df1.tar.xz
libssh-d1d3beac330d301440ea64c463933aa9950c7df1.zip
tests: Fix memory leaks.
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/torture_pki.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c
index 6edbe4c0..9f83e5db 100644
--- a/tests/unittests/torture_pki.c
+++ b/tests/unittests/torture_pki.c
@@ -981,6 +981,9 @@ static void torture_pki_write_privkey_rsa(void **state)
rc = ssh_key_cmp(origkey, privkey, SSH_KEY_CMP_PRIVATE);
assert_true(rc == 0);
+
+ ssh_key_free(origkey);
+ ssh_key_free(privkey);
}
static void torture_pki_write_privkey_dsa(void **state)
@@ -1018,6 +1021,9 @@ static void torture_pki_write_privkey_dsa(void **state)
rc = ssh_key_cmp(origkey, privkey, SSH_KEY_CMP_PRIVATE);
assert_true(rc == 0);
+
+ ssh_key_free(origkey);
+ ssh_key_free(privkey);
}
#ifdef HAVE_ECC
@@ -1056,6 +1062,9 @@ static void torture_pki_write_privkey_ecdsa(void **state)
rc = ssh_key_cmp(origkey, privkey, SSH_KEY_CMP_PRIVATE);
assert_true(rc == 0);
+
+ ssh_key_free(origkey);
+ ssh_key_free(privkey);
}
#endif