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. --- libftpconn/unix.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'libftpconn/unix.c') diff --git a/libftpconn/unix.c b/libftpconn/unix.c index 882fee8f..2804e7c4 100644 --- a/libftpconn/unix.c +++ b/libftpconn/unix.c @@ -252,14 +252,11 @@ ftp_conn_unix_start_get_stats (struct ftp_conn *conn, out: - if (req) - free (req); + free (req); if (err) { - if (s) - free (s); - if (searched_name) - free (searched_name); + free (s); + free (searched_name); } else { -- cgit v1.2.3