Tests: fix: uninitialized values passed to close() on error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 12 Sep 2019 14:08:44 +0000 (10:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:48 +0000 (15:31 -0400)
The fds array is not initialized resulting in uninitialized file
descriptors being passed to close() when an error is encountered in
the epoll-setting loop.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/select_poll_epoll.c

index 08e7fce0d898df547da42e371dc694f90bea4141..3aa639316f8796de1db89eec66dcd5d802a742e7 100644 (file)
@@ -732,6 +732,9 @@ void epoll_pwait_concurrent_munmap(void)
        struct epoll_event *epoll_event;
        pthread_t writer;
 
+       for (i = 0; i < MAX_FDS; i++) {
+               fds[i] = -1;
+       }
        epollfd = epoll_create(MAX_FDS);
        if (epollfd < 0) {
                perror("[eppoll] create");
This page took 0.02599 seconds and 4 git commands to generate.