From 5ab220d943a861df1d8546a3ecebfddbd63494a2 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Fri, 28 Jan 2011 17:36:05 +0100 Subject: [PATCH] lib: Clear the epoll event descriptor before use. --- lib/mtio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mtio.c b/lib/mtio.c index 367c61d..b65a8b0 100644 --- a/lib/mtio.c +++ b/lib/mtio.c @@ -63,7 +63,8 @@ static int regfd(struct blocker *bl) { struct blocker *o; struct epoll_event evd; - + + memset(&evd, 0, sizeof(evd)); evd.events = 0; if(bl->ev & EV_READ) evd.events |= EPOLLIN; @@ -124,6 +125,7 @@ static void remfd(struct blocker *bl) if(epoll_ctl(epfd, EPOLL_CTL_DEL, bl->fd, NULL)) flog(LOG_ERR, "epoll_del on fd %i: %s", bl->fd, strerror(errno)); } else { + memset(&evd, 0, sizeof(evd)); evd.events = 0; evd.data.fd = bl->fd; for(o = fdlist[bl->fd]; o; o = o->n2) { -- 2.11.0