Initialize nfds fields of new file structures.

Fixes possible crash when a new file structure is added in
the time-out processing code-path.
This commit is contained in:
Alexandre Ratchov 2019-11-27 09:04:04 +01:00
parent fb8bf93f11
commit c38dfbf530
1 changed files with 1 additions and 0 deletions

View File

@ -235,6 +235,7 @@ file_new(struct fileops *ops, void *arg, char *name, unsigned int nfds)
}
f = xmalloc(sizeof(struct file));
f->max_nfds = nfds;
f->nfds = 0;
f->ops = ops;
f->arg = arg;
f->name = name;