aboutsummaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-08-05 19:28:38 +0200
committerJustus Winter <justus@gnupg.org>2017-08-05 19:34:28 +0200
commit66553fd7a7bcf7c260b45f2e7ad54e98d33f8080 (patch)
tree154a543b44a17302b6618cb9c80d7e6b66703216 /proc
parent835b293d35a209d38047126443d41fa7090daa4c (diff)
downloadhurd-66553fd7a7bcf7c260b45f2e7ad54e98d33f8080.tar.gz
hurd-66553fd7a7bcf7c260b45f2e7ad54e98d33f8080.tar.bz2
hurd-66553fd7a7bcf7c260b45f2e7ad54e98d33f8080.zip
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.
Diffstat (limited to 'proc')
-rw-r--r--proc/host.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/proc/host.c b/proc/host.c
index 25066888..7d76f7cb 100644
--- a/proc/host.c
+++ b/proc/host.c
@@ -113,8 +113,7 @@ S_proc_setexecdata (struct proc *p,
mach_port_deallocate (mach_task_self (), std_port_array[i]);
free (std_port_array);
}
- if (std_int_array)
- free (std_int_array);
+ free (std_int_array);
std_port_array = std_port_array_new;
n_std_ports = nports;