Correct size for allocation and bzero of fdsr.

MFC after:	2 weeks
This commit is contained in:
delphij 2018-04-23 07:15:49 +00:00
parent 5cbcde6d07
commit 9fc237c32b

View File

@ -744,7 +744,7 @@ main(int argc, char *argv[])
fdsrmax = sl->sl_socket;
}
fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS),
sizeof(fd_mask));
sizeof(*fdsr));
if (fdsr == NULL)
errx(1, "calloc fd_set");
@ -763,7 +763,7 @@ main(int argc, char *argv[])
}
bzero(fdsr, howmany(fdsrmax+1, NFDBITS) *
sizeof(fd_mask));
sizeof(*fdsr));
STAILQ_FOREACH(sl, &shead, next) {
if (sl->sl_socket != -1 && sl->sl_recv != NULL)