summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/unittests/sshkey
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2018-07-13 02:13:20 +0000
committerDamien Miller <djm@cvs.openbsd.org>2018-07-13 02:13:20 +0000
commite38a77502257107d91d5cacb95ef662ec4eecf91 (patch)
treecec8bdfdea90cc40cff58f0f3122e2f5409ba3d6 /regress/usr.bin/ssh/unittests/sshkey
parent0e0753eae5a80c5408645d41333bce467e3e7555 (diff)
fix leaks in unit test; with this, all unit tests are leak free
(as far as valgrind can spot anyway)
Diffstat (limited to 'regress/usr.bin/ssh/unittests/sshkey')
-rw-r--r--regress/usr.bin/ssh/unittests/sshkey/test_sshkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/unittests/sshkey/test_sshkey.c b/regress/usr.bin/ssh/unittests/sshkey/test_sshkey.c
index f1bc1ec9a43..20042b4ed9b 100644
--- a/regress/usr.bin/ssh/unittests/sshkey/test_sshkey.c
+++ b/regress/usr.bin/ssh/unittests/sshkey/test_sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_sshkey.c,v 1.13 2017/12/21 00:41:22 djm Exp $ */
+/* $OpenBSD: test_sshkey.c,v 1.14 2018/07/13 02:13:19 djm Exp $ */
/*
* Regress test for sshkey.h key management API
*
@@ -411,10 +411,13 @@ sshkey_tests(void)
ASSERT_PTR_NE(k1->cert->principals[1], NULL);
ASSERT_PTR_NE(k1->cert->principals[2], NULL);
ASSERT_PTR_NE(k1->cert->principals[3], NULL);
+ k1->cert->nprincipals = 4;
k1->cert->valid_after = 0;
k1->cert->valid_before = (u_int64_t)-1;
+ sshbuf_free(k1->cert->critical);
k1->cert->critical = sshbuf_new();
ASSERT_PTR_NE(k1->cert->critical, NULL);
+ sshbuf_free(k1->cert->extensions);
k1->cert->extensions = sshbuf_new();
ASSERT_PTR_NE(k1->cert->extensions, NULL);
put_opt(k1->cert->critical, "force-command", "/usr/bin/true");