diff options
author | 2015-01-11 03:04:53 +0000 | |
---|---|---|
committer | 2015-01-11 03:04:53 +0000 | |
commit | 88c36d477c52dae5d6be9b1db67b2221c91baef0 (patch) | |
tree | d51c0460c0c71ad8230502d569708fcc62bfb062 | |
parent | KUE_MCFILTCNT() is non-constant, so use mallocarray() (diff) | |
download | wireguard-openbsd-88c36d477c52dae5d6be9b1db67b2221c91baef0.tar.xz wireguard-openbsd-88c36d477c52dae5d6be9b1db67b2221c91baef0.zip |
use mallocarray() when reallocating the mux table
-rw-r--r-- | sys/dev/wscons/wsmux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index 8546c0de920..8068ede2e1a 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.27 2014/07/12 18:48:53 tedu Exp $ */ +/* $OpenBSD: wsmux.c,v 1.28 2015/01/11 03:04:53 deraadt Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -133,8 +133,8 @@ wsmux_getmux(int n) /* Make sure there is room for mux n in the table */ if (n >= nwsmux) { old = wsmuxdevs; - new = (struct wsmux_softc **) - malloc((n + 1) * sizeof (*wsmuxdevs), M_DEVBUF, M_NOWAIT); + new = mallocarray(n + 1, sizeof (*wsmuxdevs), + M_DEVBUF, M_NOWAIT); if (new == NULL) { printf("wsmux_getmux: no memory for mux %d\n", n); return (NULL); |