diff options
author | Dmitry V. Levin <ldv@strace.io> | 2023-12-14 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-12-14 08:00:00 +0000 |
commit | 954234f0a477636eab751a6601d34bab1db41b0e (patch) | |
tree | 83403cf711c78b112e2738eb82b35d801cce18ee /modules/pam_listfile | |
parent | 297f0b554e497e95c891fd6a77f7ac5591649f26 (diff) | |
download | pam-954234f0a477636eab751a6601d34bab1db41b0e.tar.gz pam-954234f0a477636eab751a6601d34bab1db41b0e.tar.bz2 pam-954234f0a477636eab751a6601d34bab1db41b0e.zip |
treewide: assume free(NULL) is no-op
The C standard guarantees that if the argument of free() is a null
pointer, no action occurs.
Diffstat (limited to 'modules/pam_listfile')
-rw-r--r-- | modules/pam_listfile/pam_listfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/pam_listfile/pam_listfile.c b/modules/pam_listfile/pam_listfile.c index 5561b9ea..a01b5a8a 100644 --- a/modules/pam_listfile/pam_listfile.c +++ b/modules/pam_listfile/pam_listfile.c @@ -92,7 +92,7 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, else if(!strcmp(myval,"fail")) onerr = PAM_SERVICE_ERR; else { - if (ifname) free (ifname); + free(ifname); return PAM_SERVICE_ERR; } else if(!strcmp(mybuf,"sense")) @@ -101,11 +101,11 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, else if(!strcmp(myval,"deny")) sense=1; else { - if (ifname) free (ifname); + free(ifname); return onerr; } else if(!strcmp(mybuf,"file")) { - if (ifname) free (ifname); + free(ifname); ifname = malloc(strlen(myval)+1); if (!ifname) return PAM_BUF_ERR; |