diff options
author | ikerexxe <ipedrosa@redhat.com> | 2020-11-02 11:51:15 +0100 |
---|---|---|
committer | Tomáš Mráz <tmraz@redhat.com> | 2020-11-03 13:20:32 +0100 |
commit | 2d919d0b404711ff1c08cbb0443e868f0fb79846 (patch) | |
tree | 145ee62bfe955c05a05aabf10589f5c61bb2a79f /modules | |
parent | f911ce8c7377ebd1a21ee4502275098828c7c854 (diff) | |
download | pam-2d919d0b404711ff1c08cbb0443e868f0fb79846.tar.gz pam-2d919d0b404711ff1c08cbb0443e868f0fb79846.tar.bz2 pam-2d919d0b404711ff1c08cbb0443e868f0fb79846.zip |
pam_ftp: fix potential memory leak
modules/pam_ftp/pam_ftp.c: free anon_user before returning as it may be
still in use.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_ftp/pam_ftp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/pam_ftp/pam_ftp.c b/modules/pam_ftp/pam_ftp.c index b2c32b74..441f2bba 100644 --- a/modules/pam_ftp/pam_ftp.c +++ b/modules/pam_ftp/pam_ftp.c @@ -133,6 +133,8 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, retval = pam_set_item(pamh, PAM_USER, (const void *)anon_user); if (retval != PAM_SUCCESS || anon_user == NULL) { pam_syslog(pamh, LOG_ERR, "user resetting failed"); + free(anon_user); + return PAM_USER_UNKNOWN; } free(anon_user); |