Permalink
Browse files

specify free() size from the old allocation, not new allocation.

fix from C Turt
  • Loading branch information...
deraadt
deraadt committed Jun 12, 2017
1 parent 757ffb0 commit 56bd49a9467056355ad3e8a441a3dd626e0ea57c
Showing with 3 additions and 3 deletions.
  1. +3 −3 sys/dev/wscons/wsmux.c
View
@@ -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];

0 comments on commit 56bd49a

Please sign in to comment.