We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diff --git a/src/event/nc_epoll.c b/src/event/nc_epoll.c index 33aff85..c5b0a1a 100644 --- a/src/event/nc_epoll.c +++ b/src/event/nc_epoll.c @@ -103,6 +103,7 @@ event_add_in(struct event_base *evb, struct conn *c) } event.events = (uint32_t)(EPOLLIN | EPOLLET); + memset(&event.data, 0, sizeof(event.data)); event.data.ptr = c; status = epoll_ctl(ep, EPOLL_CTL_MOD, c->sd, &event); @@ -139,6 +140,7 @@ event_add_out(struct event_base *evb, struct conn *c) } event.events = (uint32_t)(EPOLLIN | EPOLLOUT | EPOLLET); + memset(&event.data, 0, sizeof(event.data)); event.data.ptr = c; status = epoll_ctl(ep, EPOLL_CTL_MOD, c->sd, &event); @@ -169,6 +171,7 @@ event_del_out(struct event_base *evb, struct conn *c) } event.events = (uint32_t)(EPOLLIN | EPOLLET); + memset(&event.data, 0, sizeof(event.data)); event.data.ptr = c; status = epoll_ctl(ep, EPOLL_CTL_MOD, c->sd, &event); @@ -194,6 +197,7 @@ event_add_conn(struct event_base *evb, struct conn *c) ASSERT(c->sd > 0); event.events = (uint32_t)(EPOLLIN | EPOLLOUT | EPOLLET); + memset(&event.data, 0, sizeof(event.data)); event.data.ptr = c; status = epoll_ctl(ep, EPOLL_CTL_ADD, c->sd, &event); @@ -307,6 +311,7 @@ event_loop_stats(event_stats_cb_t cb, void *arg) return; } + memset(&ev.data, 0, sizeof(ev.data)); ev.data.fd = st->sd; ev.events = EPOLLIN;
Because event.data is a union the stats code for fd is a false positive for valgrind.
fd
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Because event.data is a union the stats code for
fd
is a false positive for valgrind.The text was updated successfully, but these errors were encountered: