[openssh-commits] [openssh] 01/02: upstream: fix leaks in unit test; with this, all unit tests are

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jul 13 12:14:45 AEST 2018


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit dbab02f9208d9baa134cec1d007054ec82b96ca9
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Fri Jul 13 02:13:19 2018 +0000

    upstream: fix leaks in unit test; with this, all unit tests are
    
    leak free (as far as valgrind can spot anyway)
    
    OpenBSD-Regress-ID: b824d8b27998365379963440e5d18b95ca03aa17
---
 regress/unittests/sshkey/test_sshkey.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index 1aa608f9..72367bde 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/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
  *
@@ -434,10 +434,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");

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list