From 3ee6b33ad40ca1572be77d3044fa272ca1fe56b6 Mon Sep 17 00:00:00 2001 From: djm Date: Fri, 21 May 2021 04:03:47 +0000 Subject: [PATCH] fix memleak in test --- regress/usr.bin/ssh/unittests/misc/test_argv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/regress/usr.bin/ssh/unittests/misc/test_argv.c b/regress/usr.bin/ssh/unittests/misc/test_argv.c index 0ce86694d38..81c3ee7d5ca 100644 --- a/regress/usr.bin/ssh/unittests/misc/test_argv.c +++ b/regress/usr.bin/ssh/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. * @@ -53,6 +53,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"); @@ -69,6 +70,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"); @@ -98,6 +100,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"); @@ -133,6 +136,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) */ -- 2.20.1