summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorikerexxe <ipedrosa@redhat.com>2020-11-02 11:51:15 +0100
committerTomáš Mráz <tmraz@redhat.com>2020-11-03 13:20:32 +0100
commit2d919d0b404711ff1c08cbb0443e868f0fb79846 (patch)
tree145ee62bfe955c05a05aabf10589f5c61bb2a79f
parentf911ce8c7377ebd1a21ee4502275098828c7c854 (diff)
pam_ftp: fix potential memory leak
modules/pam_ftp/pam_ftp.c: free anon_user before returning as it may be still in use.
-rw-r--r--modules/pam_ftp/pam_ftp.c2
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);