summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2014-02-04 09:59:21 +0000
committereric <eric@openbsd.org>2014-02-04 09:59:21 +0000
commit9ad25316a41090717065f9bdada9b8fa7be9effe (patch)
treea113556a6198fcbce79e7a84152afc069a41839a
parentadd base64_encode/base64_decode helpers (diff)
downloadwireguard-openbsd-9ad25316a41090717065f9bdada9b8fa7be9effe.tar.xz
wireguard-openbsd-9ad25316a41090717065f9bdada9b8fa7be9effe.zip
do not call event_del() on non-initialized events
-rw-r--r--usr.sbin/smtpd/ioev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/ioev.c b/usr.sbin/smtpd/ioev.c
index 597a9f37380..faf5af642a4 100644
--- a/usr.sbin/smtpd/ioev.c
+++ b/usr.sbin/smtpd/ioev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioev.c,v 1.15 2013/12/26 17:25:32 eric Exp $ */
+/* $OpenBSD: ioev.c,v 1.16 2014/02/04 09:59:21 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -263,7 +263,8 @@ io_clear(struct io *io)
}
#endif
- event_del(&io->ev);
+ if (event_initialized(&io->ev))
+ event_del(&io->ev);
if (io->sock != -1) {
close(io->sock);
io->sock = -1;
@@ -408,7 +409,8 @@ io_reset(struct io *io, short events, void (*dispatch)(int, short, void*))
*/
io->flags |= IO_RESET;
- event_del(&io->ev);
+ if (event_initialized(&io->ev))
+ event_del(&io->ev);
/*
* The io is paused by the user, so we don't want the timeout to be