aboutsummaryrefslogtreecommitdiff
path: root/tests/test_pam_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pam_wrapper.c')
-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);
}