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