summaryrefslogtreecommitdiffstats
path: root/auth-pam.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-07-23 00:44:07 +0000
committerKevin Steves <stevesk@pobox.com>2002-07-23 00:44:07 +0000
commit38b050a0f526d1b7982deb9d19f59c95f7b91b22 (patch)
tree7594cc4c8543dd983ddbafea6170ebcacffa1847 /auth-pam.c
parent446d886fa5b295b03031de840286dbe4b7d904a3 (diff)
- (stevesk) [auth-pam.[ch] session.c] pam_getenvlist() must be
freed by the caller; add free_pam_environment() and use it.
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 79af58a0..8e149829 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -38,7 +38,7 @@ extern char *__progname;
extern int use_privsep;
-RCSID("$Id: auth-pam.c,v 1.51 2002/07/21 23:59:39 stevesk Exp $");
+RCSID("$Id: auth-pam.c,v 1.52 2002/07/23 00:44:07 stevesk Exp $");
#define NEW_AUTHTOK_MSG \
"Warning: Your password has expired, please change it now."
@@ -421,6 +421,16 @@ char **fetch_pam_environment(void)
#endif /* HAVE_PAM_GETENVLIST */
}
+void free_pam_environment(char **env)
+{
+ int i;
+
+ if (env != NULL) {
+ for (i = 0; env[i] != NULL; i++)
+ xfree(env[i]);
+ }
+}
+
/* Print any messages that have been generated during authentication */
/* or account checking to stderr */
void print_pam_messages(void)