summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2019-08-10 08:35:36 +0200
committerJose Bollo <jose.bollo@iot.bzh>2019-08-10 08:35:36 +0200
commit3a7d420edf385cdeabebc1c28440aeb9adeea1cb (patch)
tree6c8ce70b044f3411cac89e6195c13ddfc797e607
parent48eeb845bd133263bd6523f6aad88df14abf1781 (diff)
make valgrind happy
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/main-test-old-cynara.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main-test-old-cynara.c b/src/main-test-old-cynara.c
index 79e386c..ccc3baa 100644
--- a/src/main-test-old-cynara.c
+++ b/src/main-test-old-cynara.c
@@ -198,6 +198,7 @@ void asyncstscb(int old_fd, int new_fd, cynara_async_status status, void *data)
{
struct epoll_event ev;
+ memset(&ev, 0, sizeof ev);
ev.data.fd = new_fd;
ev.events = (status == CYNARA_STATUS_FOR_RW ? EPOLLOUT : 0)|EPOLLIN;
if (old_fd == new_fd) {
@@ -249,6 +250,7 @@ int main(int ac, char **av)
int rc;
pollfd = epoll_create(10);
+ memset(&ev, 0, sizeof ev);
ev.data.fd = 0;
ev.events = EPOLLIN;
epoll_ctl(pollfd, EPOLL_CTL_ADD, 0, &ev);
@@ -268,6 +270,7 @@ int main(int ac, char **av)
fcntl(0, F_SETFL, O_NONBLOCK);
bufill = 0;
for(;;) {
+ memset(&ev, 0, sizeof ev);
epoll_wait(pollfd, &ev, 1, -1);
if (ev.data.fd == 0) {