summaryrefslogtreecommitdiff
path: root/modules/pam_listfile/pam_listfile.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-05-22 17:27:54 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-05-22 17:27:54 +0000
commit9251be9693b1c8c56ed067438858e740cba57570 (patch)
tree17fe57914bae9c80901e3288831a14f43524b539 /modules/pam_listfile/pam_listfile.c
parent747fce30ecb18b776fd91aefdcf3ab3508b42fbf (diff)
Relevant BUGIDs: 1490956,1489818,1489808,1489792,1489804,1489658,1489634
Purpose of commit: bugfixes Commit summary: --------------- 2006-05-22 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_listfile/pam_listfile.c (pam_sm_authenticate): Fix memory leaks, [#1490956] found by Coverity. * modules/pam_tally/pam_tally.c (pam_get_uid): Check return value of pam_get_user(). (tally_get_data): Check if oldtime is not NULL. [#1489818] found by Coverity. * modules/pam_mkhomedir/pam_mkhomedir.c (create_homedir): Don't ignore return value of stat(). [#1489808] found by Coverity. * modules/pam_mail/pam_mail.c (get_folder): Fix a potential NULL pointer dereference. [#1489792] found by Coverity. * libpam/Makefile.am: bump release number of libpam.so. * libpam/pam_misc.c (_pam_mkargv): Fix memory leak, [#1489804] found by Coverity. * modules/pam_echo/pam_echo.c (replace_and_print): Initialize str, [#1489658] found by Coverity. * modules/pam_cracklib/pam_cracklib.c (_pam_unix_approve_pass): Fix a potential NULL pointer dereference. (pam_sm_chauthtok): Remove dead code. [#1489634] found by Coverity.
Diffstat (limited to 'modules/pam_listfile/pam_listfile.c')
-rw-r--r--modules/pam_listfile/pam_listfile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/pam_listfile/pam_listfile.c b/modules/pam_listfile/pam_listfile.c
index 69384be6..1545fe03 100644
--- a/modules/pam_listfile/pam_listfile.c
+++ b/modules/pam_listfile/pam_listfile.c
@@ -108,16 +108,21 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
onerr = PAM_SUCCESS;
else if(!strcmp(myval,"fail"))
onerr = PAM_SERVICE_ERR;
- else
+ else {
+ if (ifname) free (ifname);
return PAM_SERVICE_ERR;
+ }
else if(!strcmp(mybuf,"sense"))
if(!strcmp(myval,"allow"))
sense=0;
else if(!strcmp(myval,"deny"))
sense=1;
- else
+ else {
+ if (ifname) free (ifname);
return onerr;
+ }
else if(!strcmp(mybuf,"file")) {
+ if (ifname) free (ifname);
ifname = (char *)malloc(strlen(myval)+1);
if (!ifname)
return PAM_BUF_ERR;
@@ -176,6 +181,7 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
) {
pam_syslog(pamh,LOG_ERR,
"Invalid usage for apply= parameter");
+ free (ifname);
return onerr;
}