From: fcambus Date: Wed, 17 Jan 2018 16:54:19 +0000 (+0000) Subject: Add sizes for free() in wscons(4). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0432d210288d5a91bcb9ce9e5ae8abdc269fe147;p=openbsd Add sizes for free() in wscons(4). OK deraadt@, visa@, mpi@ --- diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 5719481413d..35cfff6454e 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.129 2017/07/19 20:12:54 kettenis Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.130 2018/01/17 16:54:19 fcambus Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -3326,7 +3326,7 @@ allocate_copybuffer(struct wsdisplay_softc *sc) } if (size != sc->sc_copybuffer_size && sc->sc_copybuffer_size != 0) { bzero(sc->sc_copybuffer, sc->sc_copybuffer_size); - free(sc->sc_copybuffer, M_DEVBUF, 0); + free(sc->sc_copybuffer, M_DEVBUF, sc->sc_copybuffer_size); } if ((sc->sc_copybuffer = (char *)malloc(size, M_DEVBUF, M_NOWAIT)) == NULL) { diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index c116fad6278..7316b2e60d1 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.87 2017/05/12 09:16:55 mpi Exp $ */ +/* $OpenBSD: wskbd.c,v 1.88 2018/01/17 16:54:19 fcambus Exp $ */ /* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */ /* @@ -1126,7 +1126,7 @@ getkeyrepeat: KB_HANDLEDBYWSKBD); wskbd_update_layout(sc->id, enc); } - free(buf, M_TEMP, 0); + free(buf, M_TEMP, len); return(error); case WSKBDIO_GETMAP: