-/* $OpenBSD: wskbd.c,v 1.88 2018/01/17 16:54:19 fcambus Exp $ */
+/* $OpenBSD: wskbd.c,v 1.89 2018/01/22 12:20:54 fcambus Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
splx(s);
}
- free(sc->sc_map, M_DEVBUF, 0);
+ free(sc->sc_map, M_DEVBUF,
+ sc->sc_maplen * sizeof(struct wscons_keymap));
/* locate the major number */
for (maj = 0; maj < nchrdev; maj++)
-/* $OpenBSD: wskbdutil.c,v 1.16 2017/09/08 05:36:53 deraadt Exp $ */
+/* $OpenBSD: wskbdutil.c,v 1.17 2018/01/22 12:20:54 fcambus Exp $ */
/* $NetBSD: wskbdutil.c,v 1.7 1999/12/21 11:59:13 drochner Exp $ */
/*-
if (newlen != *maplen) {
if (*maplen > 0)
- free(*map, M_DEVBUF, 0);
+ free(*map, M_DEVBUF,
+ *maplen * sizeof(struct wscons_keymap));
*maplen = newlen;
*map = mallocarray(newlen, sizeof(struct wscons_keymap),
M_DEVBUF, M_WAITOK);