diff options
author | 2014-07-13 15:29:04 +0000 | |
---|---|---|
committer | 2014-07-13 15:29:04 +0000 | |
commit | 47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f (patch) | |
tree | 314cb49ac3d0a1406adb1335a1738dab82084923 /sys/kern/exec_subr.c | |
parent | Sync file to be identical in relayd(8) and httpd(8). (diff) | |
download | wireguard-openbsd-47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f.tar.xz wireguard-openbsd-47e7ee29c3bb7cf8aea4f2198bbeaca547bc731f.zip |
use mallocarray where arguments are multipled. ok deraadt
Diffstat (limited to 'sys/kern/exec_subr.c')
-rw-r--r-- | sys/kern/exec_subr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index ae01762c5ba..ae3a4cc0a8a 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.36 2014/07/12 18:43:32 tedu Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.37 2014/07/13 15:29:04 tedu Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -91,7 +91,7 @@ vmcmdset_extend(struct exec_vmcmd_set *evsp) evsp->evs_cnt += ocnt; /* reallocate the command set */ - nvcp = malloc(evsp->evs_cnt * sizeof(struct exec_vmcmd), M_EXEC, + nvcp = mallocarray(evsp->evs_cnt, sizeof(struct exec_vmcmd), M_EXEC, M_WAITOK); bcopy(evsp->evs_cmds, nvcp, (ocnt * sizeof(struct exec_vmcmd))); if (evsp->evs_cmds != evsp->evs_start) |