aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2021-04-19 16:12:30 +0200
committerAndreas Schneider <asn@cryptomilk.org>2021-04-19 16:13:53 +0200
commit561af2be692c63894ad1b0563d649c8bdaa8e3ad (patch)
treec6a4e6e66c05007d53ae0e4c9bdf032d8eedf89f
parentab2d90c6def33888db86755e23f3c12d417e187f (diff)
downloadpam_wrapper-asn-free.tar.gz
pam_wrapper-asn-free.tar.xz
pam_wrapper-asn-free.zip
tests: Correctly implement free_vlist()asn-free
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--tests/test_pam_wrapper.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_pam_wrapper.c b/tests/test_pam_wrapper.c
index c8cb043..7e8b9ee 100644
--- a/tests/test_pam_wrapper.c
+++ b/tests/test_pam_wrapper.c
@@ -340,8 +340,11 @@ static void test_pam_acct_err(void **state)
static inline void free_vlist(char **vlist)
{
- free(vlist[0]);
- free(vlist[1]);
+ size_t i;
+
+ for (i = 0; vlist[i] != NULL; i++) {
+ free(vlist[i]);
+ }
free(vlist);
}