summaryrefslogtreecommitdiff
path: root/sys/kern/exec_subr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
commit774f0773b4dd6e6d1c57c4a21a1b5c94c36848e1 (patch)
tree7bbf567ac5db4f4ce15690674823b6216809cbc8 /sys/kern/exec_subr.c
parenta7ef034be229b99dee62d52b449fba299be46bb9 (diff)
pass size argument to free()
ok doug tedu
Diffstat (limited to 'sys/kern/exec_subr.c')
-rw-r--r--sys/kern/exec_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c
index ae3a4cc0a8a..db2783c53cb 100644
--- a/sys/kern/exec_subr.c
+++ b/sys/kern/exec_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_subr.c,v 1.37 2014/07/13 15:29:04 tedu Exp $ */
+/* $OpenBSD: exec_subr.c,v 1.38 2014/11/03 03:08:00 deraadt Exp $ */
/* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */
/*
@@ -95,7 +95,7 @@ vmcmdset_extend(struct exec_vmcmd_set *evsp)
M_WAITOK);
bcopy(evsp->evs_cmds, nvcp, (ocnt * sizeof(struct exec_vmcmd)));
if (evsp->evs_cmds != evsp->evs_start)
- free(evsp->evs_cmds, M_EXEC, 0);
+ free(evsp->evs_cmds, M_EXEC, ocnt * sizeof(struct exec_vmcmd));
evsp->evs_cmds = nvcp;
}
@@ -307,7 +307,7 @@ vmcmd_randomize(struct proc *p, struct exec_vmcmd *cmd)
buf = malloc(cmd->ev_len, M_TEMP, M_WAITOK);
arc4random_buf(buf, cmd->ev_len);
error = copyout(buf, (void *)cmd->ev_addr, cmd->ev_len);
- free(buf, M_TEMP, 0);
+ free(buf, M_TEMP, cmd->ev_len);
return (error);
}