summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-02-18 14:22:53 +0100
committerChristian Göttsche <cgzones@googlemail.com>2023-02-28 15:11:18 +0100
commitbde2277d2aa1cd9d4a14a1a1f89241d5e86b0bad (patch)
tree899647c2a99001a529aae8678f0207a817139494
parent81e74d598b080de5c6a66585ebf2a9d6d1186f00 (diff)
downloadlinux-pam-git-bde2277d2aa1cd9d4a14a1a1f89241d5e86b0bad.tar.gz
pam_env: use helper to free string list
Free the environment variables list via the designated helper free_string_array() rather than free its elements in a loop, which might skip some.
-rw-r--r--modules/pam_env/pam_env.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index 2868cfce..42842308 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -992,11 +992,10 @@ _parse_env_file(pam_handle_t *pamh, int ctrl, const char *file)
pam_syslog(pamh, LOG_DEBUG,
"pam_putenv(\"%s\")", key);
}
- free(*env);
}
/* tidy up */
- free(env_list);
+ free_string_array(env_list);
D(("Exit."));
return retval;
}