From a1950248ee3fb08374b5733afc3d9f123634319b Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Mon, 30 May 2011 19:36:56 +0200 Subject: 2011-05-30 Thorsten Kukuk * modules/pam_timestamp/pam_timestamp.c (main): Remove unsused variable pretval. * modules/pam_stress/pam_stress.c (converse): **message is const. (stress_get_password): pmsg is const. (pam_sm_chauthtok): Likewise. * libpam/pam_item.c (pam_get_user): Make pmsg const and remove casts. --- modules/pam_timestamp/pam_timestamp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/pam_timestamp') diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c index 26876769..7bcf3d12 100644 --- a/modules/pam_timestamp/pam_timestamp.c +++ b/modules/pam_timestamp/pam_timestamp.c @@ -684,7 +684,7 @@ struct pam_module _pam_timestamp_modstruct = { int main(int argc, char **argv) { - int i, pretval = -1, retval = 0, dflag = 0, kflag = 0; + int i, retval = 0, dflag = 0, kflag = 0; const char *target_user = NULL, *user = NULL, *tty = NULL; struct passwd *pwd; struct timeval tv; @@ -826,7 +826,6 @@ main(int argc, char **argv) select(STDOUT_FILENO + 1, NULL, NULL, &write_fds, &tv); - pretval = retval; retval = 0; } } while (dflag > 0); -- cgit v1.2.3 From 2daaafacf771746a11849ada2166f8ac2bab1348 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 15 Jun 2011 20:58:32 +0200 Subject: Avoid memleaks and fd leak in error paths. --- modules/pam_timestamp/pam_timestamp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/pam_timestamp') diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c index 7bcf3d12..51937333 100644 --- a/modules/pam_timestamp/pam_timestamp.c +++ b/modules/pam_timestamp/pam_timestamp.c @@ -483,6 +483,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) pam_syslog(pamh, LOG_NOTICE, "timestamp file `%s' is " "corrupted", path); close(fd); + free(mac); free(message); return PAM_AUTH_ERR; } @@ -636,6 +637,8 @@ pam_sm_open_session(pam_handle_t *pamh, int flags UNUSED, int argc, const char * "error setting ownership of `%s': %m", path); } + close(fd); + free(text); return PAM_SESSION_ERR; } -- cgit v1.2.3