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_stress/pam_stress.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'modules/pam_stress') diff --git a/modules/pam_stress/pam_stress.c b/modules/pam_stress/pam_stress.c index b2c55586..d0f54016 100644 --- a/modules/pam_stress/pam_stress.c +++ b/modules/pam_stress/pam_stress.c @@ -476,10 +476,8 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags, resp = NULL; retval = converse(pamh,i,pmsg,&resp); - if (txt) { - free(txt); - txt = NULL; /* clean up */ - } + free(txt); + txt = NULL; /* clean up */ if (retval != PAM_SUCCESS) { return retval; } -- cgit v1.2.3