summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-09-26 14:01:40 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-09-26 14:01:40 +0000
commita4ba45aa8ff49696e29a6ed776ac4323979b6a0b (patch)
treefde7f3340ff238f94942119a6bee96120583eb00 /sys/kern/kern_exec.c
parentfe62e6305dc011bf50462c95485e56f7726e049d (diff)
Don't use MALLOC/FREE on variable sized allocations.
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index b5de0c02c0d..098edd5049e 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.42 2000/04/20 10:03:42 art Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.43 2000/09/26 14:01:39 art Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -263,7 +263,7 @@ sys_execve(p, v, retval)
* initialize the fields of the exec package.
*/
pack.ep_name = (char *)SCARG(uap, path);
- MALLOC(pack.ep_hdr, void *, exec_maxhdrsz, M_EXEC, M_WAITOK);
+ pack.ep_hdr = malloc(exec_maxhdrsz, M_EXEC, M_WAITOK);
pack.ep_hdrlen = exec_maxhdrsz;
pack.ep_hdrvalid = 0;
pack.ep_ndp = &nid;
@@ -305,7 +305,7 @@ sys_execve(p, v, retval)
*dp++ = *cp++;
dp++;
- FREE(*tmpfap, M_EXEC);
+ free(*tmpfap, M_EXEC);
tmpfap++; argc++;
}
FREE(pack.ep_fa, M_EXEC);
@@ -601,7 +601,7 @@ sys_execve(p, v, retval)
psignal(p, SIGTRAP);
p->p_emul = pack.ep_emul;
- FREE(pack.ep_hdr, M_EXEC);
+ free(pack.ep_hdr, M_EXEC);
#ifdef KTRACE
if (KTRPOINT(p, KTR_EMUL))
@@ -628,7 +628,7 @@ bad:
#endif
freehdr:
- FREE(pack.ep_hdr, M_EXEC);
+ free(pack.ep_hdr, M_EXEC);
return (error);
exec_abort:
@@ -656,7 +656,7 @@ exec_abort:
#endif
free_pack_abort:
- FREE(pack.ep_hdr, M_EXEC);
+ free(pack.ep_hdr, M_EXEC);
exit1(p, W_EXITCODE(0, SIGABRT));
exit1(p, -1);