diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2011-06-15 20:58:32 +0200 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2011-06-15 20:58:32 +0200 |
commit | 2daaafacf771746a11849ada2166f8ac2bab1348 (patch) | |
tree | 961f3161a4e52b047306ad121c4b669c5ef14e62 | |
parent | 53d6722ab192193c77d187645a31949d3de65f2b (diff) | |
download | pam-2daaafacf771746a11849ada2166f8ac2bab1348.tar.gz pam-2daaafacf771746a11849ada2166f8ac2bab1348.tar.bz2 pam-2daaafacf771746a11849ada2166f8ac2bab1348.zip |
Avoid memleaks and fd leak in error paths.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | modules/pam_timestamp/pam_timestamp.c | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -14,6 +14,10 @@ * modules/pam_unix/support.c (_set_ctrl): Do not crash when remember, minlen, or rounds options are used with wrong module type. + * modules/pam_timestamp/pam_timestamp.c (pam_sm_authenticate): Avoid + memleak in error path. + (pam_sm_open_session): Avoid memleak and fd leak in error path. + 2011-06-14 Thorsten Kukuk <kukuk@thkukuk.de> * configure.in: Check for libtirpc by default. 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; } |