From 66553fd7a7bcf7c260b45f2e7ad54e98d33f8080 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Sat, 5 Aug 2017 19:28:38 +0200 Subject: Simplify deallocations. free (NULL) is a nop, therefore it is not necessary to check that first. Simplify the code accordingly. This commit is the result of the following semantic patch: @@ identifier X; @@ -if (X) free (X); +free (X); * console-client/console.c: Simplify accordingly. * console-client/driver.c: Likewise. * console-client/vga.c: Likewise. * ftpfs/dir.c: Likewise. * libftpconn/unix.c: Likewise. * libps/fmt.c: Likewise. * libps/proclist.c: Likewise. * libstore/mvol.c: Likewise. * nfs/ops.c: Likewise. * proc/host.c: Likewise. * sutils/fstab.c: Likewise. --- sutils/fstab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sutils') diff --git a/sutils/fstab.c b/sutils/fstab.c index 2e125d8d..9748ae9b 100644 --- a/sutils/fstab.c +++ b/sutils/fstab.c @@ -617,7 +617,7 @@ fstab_add_mntent (struct fstab *const fstab, const struct mntent *mntent, { if (! err) _fstab_add (fstab, fs); - else if (fs) + else free (fs); } -- cgit v1.2.3