aboutsummaryrefslogtreecommitdiff
path: root/libpam/pam_modutil_getspnam.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-12-14 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-12-14 08:00:00 +0000
commit954234f0a477636eab751a6601d34bab1db41b0e (patch)
tree83403cf711c78b112e2738eb82b35d801cce18ee /libpam/pam_modutil_getspnam.c
parent297f0b554e497e95c891fd6a77f7ac5591649f26 (diff)
downloadpam-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 'libpam/pam_modutil_getspnam.c')
-rw-r--r--libpam/pam_modutil_getspnam.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libpam/pam_modutil_getspnam.c b/libpam/pam_modutil_getspnam.c
index 2673668c..8b48db90 100644
--- a/libpam/pam_modutil_getspnam.c
+++ b/libpam/pam_modutil_getspnam.c
@@ -44,9 +44,7 @@ pam_modutil_getspnam(pam_handle_t *pamh, const char *user)
D(("out of memory"));
/* no memory for the user - so delete the memory */
- if (buffer) {
- free(buffer);
- }
+ free(buffer);
return NULL;
}
buffer = new_buffer;