diff options
Diffstat (limited to 'modules/pam_listfile/pam_listfile.c')
-rw-r--r-- | modules/pam_listfile/pam_listfile.c | 10 |
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; } |