summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-03-17 18:24:07 +0000
committernicm <nicm@openbsd.org>2012-03-17 18:24:07 +0000
commit346357b798ef0748da3b6bdd1c273831780b783f (patch)
tree5fa368b6618858af7d029dffd2ab840ea7108706 /usr.bin/tmux/tty.c
parentRedirect libevent logging to tmux's log. (diff)
downloadwireguard-openbsd-346357b798ef0748da3b6bdd1c273831780b783f.tar.xz
wireguard-openbsd-346357b798ef0748da3b6bdd1c273831780b783f.zip
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 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 135d22bde50..11b50f4f6fd 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.122 2012/03/17 17:36:03 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.123 2012/03/17 18:24:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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) {