diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2013-07-04 17:37:06 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2013-07-04 17:37:06 +0000 |
commit | 60ce41b66121f38843b60b67a6390ef6e0d758de (patch) | |
tree | 9ece8739606f8eaae728dbc17ba4985d7d4d5cd7 | |
parent | 8a6713047bfb9a490715c69aac3515eb989f7dcd (diff) |
now that free(null) is safe, delete checks
-rw-r--r-- | sys/kern/exec_elf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index df5b09dffcb..bd959e3da25 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.92 2013/06/02 16:41:37 guenther Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.93 2013/07/04 17:37:05 tedu Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -491,8 +491,7 @@ ELFNAME(load_file)(struct proc *p, char *path, struct exec_package *epp, bad1: VOP_CLOSE(nd.ni_vp, FREAD, p->p_ucred, p); bad: - if (ph != NULL) - free(ph, M_TEMP); + free(ph, M_TEMP); *last = addr; vput(nd.ni_vp); @@ -904,8 +903,7 @@ ELFNAME(os_pt_note)(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh, out3: error = ENOEXEC; out2: - if (np) - free(np, M_TEMP); + free(np, M_TEMP); out1: free(hph, M_TEMP); return error; @@ -1080,8 +1078,7 @@ ELFNAMEEND(coredump)(struct proc *p, void *cookie) } out: - if (psections) - free(psections, M_TEMP); + free(psections, M_TEMP); return (error); #endif } |