summaryrefslogtreecommitdiffstats
path: root/status.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 /status.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 'status.c')
-rw-r--r--status.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/status.c b/status.c
index 0342b5f1..8338fbe4 100644
--- a/status.c
+++ b/status.c
@@ -776,7 +776,8 @@ status_message_set(struct client *c, const char *fmt, ...)
tv.tv_sec = delay / 1000;
tv.tv_usec = (delay % 1000) * 1000L;
- evtimer_del(&c->message_timer);
+ if (event_initialized (&c->message_timer))
+ evtimer_del(&c->message_timer);
evtimer_set(&c->message_timer, status_message_callback, c);
evtimer_add(&c->message_timer, &tv);