summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-03-17 18:24:07 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-03-17 18:24:07 +0000
commitd3c842d3678e52275c944123f00a2a974eb5d965 (patch)
treed0b234a4364504e17f53d90aa3e635134c0f01cc /tty.c
parenta597e3546cf667c2db91aea5545d2cb2125366f5 (diff)
Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index c7e603c1..4ea999ba 100644
--- a/tty.c
+++ b/tty.c
@@ -279,7 +279,8 @@ tty_close(struct tty *tty)
tty->log_fd = -1;
}
- evtimer_del(&tty->key_timer);
+ if (event_initialized(&tty->key_timer))
+ evtimer_del(&tty->key_timer);
tty_stop_tty(tty);
if (tty->flags & TTY_OPENED) {