Merge pull request #356 from utoni/fix/watcher-unitialised-value

Fixes unitialised memory access as seen in issue #355.
This commit is contained in:
Yves Rutschle 2022-09-22 21:10:12 +02:00 committed by GitHub
commit 7e3f723699
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,9 @@ static void watchers_init(watchers** w, struct listen_endpoint* listen_sockets,
int num_addr_listen)
{
*w = malloc(sizeof(**w));
CHECK_ALLOC(*w, "malloc");
memset(*w, 0, sizeof(**w));
FD_ZERO(&(*w)->fds_r);
FD_ZERO(&(*w)->fds_w);