summaryrefslogtreecommitdiff
path: root/sys/kern/tty_endrun.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-11-03 03:08:01 +0000
commit774f0773b4dd6e6d1c57c4a21a1b5c94c36848e1 (patch)
tree7bbf567ac5db4f4ce15690674823b6216809cbc8 /sys/kern/tty_endrun.c
parenta7ef034be229b99dee62d52b449fba299be46bb9 (diff)
pass size argument to free()
ok doug tedu
Diffstat (limited to 'sys/kern/tty_endrun.c')
-rw-r--r--sys/kern/tty_endrun.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty_endrun.c b/sys/kern/tty_endrun.c
index c12b767f69f..7773842a789 100644
--- a/sys/kern/tty_endrun.c
+++ b/sys/kern/tty_endrun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_endrun.c,v 1.5 2014/09/14 14:17:26 jsg Exp $ */
+/* $OpenBSD: tty_endrun.c,v 1.6 2014/11/03 03:08:00 deraadt Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
@@ -154,7 +154,7 @@ endrunopen(dev_t dev, struct tty *tp, struct proc *p)
error = linesw[TTYDISC].l_open(dev, tp, p);
if (error) {
- free(np, M_DEVBUF, 0);
+ free(np, M_DEVBUF, sizeof(*np));
tp->t_sc = NULL;
} else {
sensordev_install(&np->timedev);
@@ -173,7 +173,7 @@ endrunclose(struct tty *tp, int flags, struct proc *p)
tp->t_line = TTYDISC; /* switch back to termios */
timeout_del(&np->endrun_tout);
sensordev_deinstall(&np->timedev);
- free(np, M_DEVBUF, 0);
+ free(np, M_DEVBUF, sizeof(*np));
tp->t_sc = NULL;
endrun_count--;
if (endrun_count == 0)