mirror of https://github.com/ericonr/sndio.git
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:
parent
fb8bf93f11
commit
c38dfbf530
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue