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: 5178f8c5af ("utmp: call prepare_utmp() even if utent is NULL")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
b11129827a
commit
5c86700fd7
+2
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user