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. --- libpam/pam_modutil_cleanup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libpam/pam_modutil_cleanup.c') diff --git a/libpam/pam_modutil_cleanup.c b/libpam/pam_modutil_cleanup.c index 8224ce67..2077cbd7 100644 --- a/libpam/pam_modutil_cleanup.c +++ b/libpam/pam_modutil_cleanup.c @@ -12,8 +12,6 @@ void pam_modutil_cleanup (pam_handle_t *pamh UNUSED, void *data, int error_status UNUSED) { - if (data) { /* junk it */ - (void) free(data); - } + free(data); } -- cgit v1.2.3