diff options
author | djm@openbsd.org <djm@openbsd.org> | 2021-05-21 06:03:47 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-06-01 06:38:41 +0200 |
commit | 1a4d1da9188d7c88f646b61f0d6a3b34f47c5439 (patch) | |
tree | 36bb37cbda3bbd0b84d33d522471fb494dd6917b /regress/unittests | |
parent | upstream: also check contents of remaining string (diff) | |
download | openssh-1a4d1da9188d7c88f646b61f0d6a3b34f47c5439.tar.xz openssh-1a4d1da9188d7c88f646b61f0d6a3b34f47c5439.zip |
upstream: fix memleak in test
OpenBSD-Regress-ID: 5e529d0982aa04666604936df43242e97a7a6f81
Diffstat (limited to 'regress/unittests')
-rw-r--r-- | regress/unittests/misc/test_argv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/regress/unittests/misc/test_argv.c b/regress/unittests/misc/test_argv.c index 7a28f64e5..a422a2019 100644 --- a/regress/unittests/misc/test_argv.c +++ b/regress/unittests/misc/test_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test_argv.c,v 1.1 2021/03/19 04:23:50 djm Exp $ */ +/* $OpenBSD: test_argv.c,v 1.2 2021/05/21 04:03:47 djm Exp $ */ /* * Regress test for misc argv handling functions. * @@ -55,6 +55,7 @@ test_argv(void) ASSERT_INT_EQ(ac, 0); ASSERT_PTR_NE(av, NULL); ASSERT_PTR_EQ(av[0], NULL); + RESET_ARGV(); TEST_DONE(); TEST_START("trivial args"); @@ -71,6 +72,7 @@ test_argv(void) ASSERT_STRING_EQ(av[0], "smiley"); ASSERT_STRING_EQ(av[1], "leamas"); ASSERT_PTR_EQ(av[2], NULL); + RESET_ARGV(); TEST_DONE(); TEST_START("quoted"); @@ -100,6 +102,7 @@ test_argv(void) ASSERT_STRING_EQ(av[0], "smiley leamas"); ASSERT_STRING_EQ(av[1], "liz"); ASSERT_PTR_EQ(av[2], NULL); + RESET_ARGV(); TEST_DONE(); TEST_START("escaped"); @@ -135,6 +138,7 @@ test_argv(void) ASSERT_STRING_EQ(av[0], "leamas\\"); ASSERT_STRING_EQ(av[1], "\\smiley"); ASSERT_PTR_EQ(av[2], NULL); + RESET_ARGV(); TEST_DONE(); /* XXX test char *argv_assemble(int argc, char **argv) */ |