summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Cambus <fcambus@cvs.openbsd.org>2018-01-17 16:54:20 +0000
committerFrederic Cambus <fcambus@cvs.openbsd.org>2018-01-17 16:54:20 +0000
commit544b1530f83b6fc75b39df563675077a9d95ce07 (patch)
tree2b5d1b4585bdde47c3cc82d690b8a0601c679038
parent64822df4312315887a4cd5080f68dff9a4a837b1 (diff)
Add sizes for free() in wscons(4).
OK deraadt@, visa@, mpi@
-rw-r--r--sys/dev/wscons/wsdisplay.c4
-rw-r--r--sys/dev/wscons/wskbd.c4
2 files changed, 4 insertions, 4 deletions
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: