diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-06-12 13:45:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-06-12 13:45:40 +0000 |
commit | 313a9f9dbc17a99d90b74769f13b57c403262d04 (patch) | |
tree | 61d6e8cfc71f5964cd4784dc10c42c35f439acdf /sys/dev | |
parent | 3d670c08ba6f83da072a4aa072a96fe83ce16d56 (diff) |
specify free() size from the old allocation, not new allocation.
fix from C Turt
Diffstat (limited to 'sys/dev')
-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 90c7b20d3a6..c8654dc01e1 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.31 2015/09/10 18:14:52 mpi Exp $ */ +/* $OpenBSD: wsmux.c,v 1.32 2017/06/12 13:45:39 deraadt Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -142,10 +142,10 @@ wsmux_getmux(int n) bcopy(old, new, nwsmux * sizeof(*wsmuxdevs)); for (i = nwsmux; i < (n + 1); i++) new[i] = NULL; - wsmuxdevs = new; - nwsmux = n + 1; if (old != NULL) free(old, M_DEVBUF, nwsmux * sizeof(*wsmuxdevs)); + wsmuxdevs = new; + nwsmux = n + 1; } sc = wsmuxdevs[n]; |