diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-03-18 01:59:34 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-03-18 01:59:34 +0000 |
commit | 0987d552315b5781157846c23eee0ddaab4702d7 (patch) | |
tree | ae795f2be215e431d562f6985f1430c9022eaba7 /server-client.c | |
parent | 5aa28473dd76c6c10c5e2e9d303250c8f8881e05 (diff) |
Sync OpenBSD patchset 1057:
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 'server-client.c')
-rw-r--r-- | server-client.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c index c53d0d97..a88230d4 100644 --- a/server-client.c +++ b/server-client.c @@ -152,11 +152,13 @@ server_client_lost(struct client *c) evtimer_del(&c->repeat_timer); - evtimer_del(&c->identify_timer); + if (event_initialized(&c->identify_timer)) + evtimer_del(&c->identify_timer); if (c->message_string != NULL) xfree(c->message_string); - evtimer_del(&c->message_timer); + if (event_initialized (&c->message_timer)) + evtimer_del(&c->message_timer); for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) { msg = &ARRAY_ITEM(&c->message_log, i); xfree(msg->msg); @@ -175,7 +177,8 @@ server_client_lost(struct client *c) close(c->ibuf.fd); imsg_clear(&c->ibuf); - event_del(&c->event); + if (event_initialized(&c->event)) + event_del(&c->event); for (i = 0; i < ARRAY_LENGTH(&dead_clients); i++) { if (ARRAY_ITEM(&dead_clients, i) == NULL) { |