summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-22 05:31:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-22 05:31:34 +0000
commitf5ce639e4d14c5d10adcf3a7e4994901239f6e63 (patch)
treeddc48e956e409b92d9e8899d6a513a62cfa8f3b5 /sys/kern/kern_exec.c
parent274136eded16f9b0fbb3c630d6dbdd07cf892aba (diff)
memory leak in execve with systrace, plus some unreachable code
spotted by Maxime Villard ok guenther millert
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index f6b90f810fb..76cf228f33e 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.162 2015/07/20 00:56:10 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.163 2015/07/22 05:31:33 deraadt Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -785,12 +785,12 @@ exec_abort:
free_pack_abort:
free(pack.ep_hdr, M_EXEC, 0);
+ if (pathbuf != NULL)
+ pool_put(&namei_pool, pathbuf);
exit1(p, W_EXITCODE(0, SIGABRT), EXIT_NORMAL);
/* NOTREACHED */
atomic_clearbits_int(&pr->ps_flags, PS_INEXEC);
- if (pathbuf != NULL)
- pool_put(&namei_pool, pathbuf);
return (0);
}