From: Jérémie Galarneau Date: Thu, 12 Sep 2019 14:08:44 +0000 (-0400) Subject: Tests: fix: uninitialized values passed to close() on error X-Git-Tag: v2.10.8~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dc752d5430fe106304f787c79d095d6838d0ca99;p=lttng-tools.git Tests: fix: uninitialized values passed to close() on error 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 --- diff --git a/tests/regression/kernel/select_poll_epoll.c b/tests/regression/kernel/select_poll_epoll.c index 08e7fce0d..3aa639316 100644 --- a/tests/regression/kernel/select_poll_epoll.c +++ b/tests/regression/kernel/select_poll_epoll.c @@ -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");