From 954234f0a477636eab751a6601d34bab1db41b0e Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 14 Dec 2023 08:00:00 +0000 Subject: treewide: assume free(NULL) is no-op The C standard guarantees that if the argument of free() is a null pointer, no action occurs. --- modules/pam_unix/pam_unix_auth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/pam_unix/pam_unix_auth.c') diff --git a/modules/pam_unix/pam_unix_auth.c b/modules/pam_unix/pam_unix_auth.c index 4eccff8e..976699d4 100644 --- a/modules/pam_unix/pam_unix_auth.c +++ b/modules/pam_unix/pam_unix_auth.c @@ -86,8 +86,7 @@ do { \ static void setcred_free (pam_handle_t *pamh UNUSED, void *ptr, int err UNUSED) { - if (ptr) - free (ptr); + free (ptr); } int -- cgit v1.2.3