diff options
author | Alejandro Colomar <alx@kernel.org> | 2023-10-29 19:46:02 +0100 |
---|---|---|
committer | Serge Hallyn <serge@hallyn.com> | 2023-10-29 21:12:02 -0500 |
commit | 5c86700fd7b5525406cdcc5d1b16ca4cf8874acd (patch) | |
tree | 1dd4869753bd1d11dfc163d06d491cf7368c6910 | |
parent | b11129827a7e3e21e040974f0bd31b04d05e23f3 (diff) |
lib/utmp.c: Don't check for NULL before free(3)
free(NULL) is valid; there's no need to check for NULL. Simplify.
Fixes: 5178f8c5afb6 ("utmp: call prepare_utmp() even if utent is NULL")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | lib/utmp.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -374,10 +374,8 @@ int update_utmp (const char *user, (void) setutmp (ut); /* make entry in the utmp & wtmp files */ - if (utent != NULL) { - free (utent); - } - free (ut); + free(utent); + free(ut); return 0; } |