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.12.0-rc1~395 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7f6288c8728f0a161456f4b86e4e4b513104723b;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");