changeset 4666:fd10404f5965 HEAD

Don't pass uninitialized data in epoll data struct's union to kernel. Doesn't matter that much, but keeps valgrind happy.
author Timo Sirainen <tss@iki.fi>
date Sat, 14 Oct 2006 01:12:53 +0300
parents e4d7d01b0784
children 4cd8792b5fcb
files src/lib/ioloop-epoll.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-epoll.c	Fri Oct 13 23:23:13 2006 +0300
+++ b/src/lib/ioloop-epoll.c	Sat Oct 14 01:12:53 2006 +0300
@@ -92,6 +92,7 @@
 
 	first = ioloop_iolist_add(*list, io);
 
+	memset(&event, 0, sizeof(event));
 	event.data.ptr = *list;
 	event.events = epoll_event_mask(*list);
 
@@ -123,6 +124,7 @@
 	list = array_idx_modifiable(&ctx->fd_index, io->fd);
 	last = ioloop_iolist_del(*list, io);
 
+	memset(&event, 0, sizeof(event));
 	event.data.ptr = *list;
 	event.events = epoll_event_mask(*list);