Index: child.c
===================================================================
RCS file: /cvs/src/usr.bin/rdist/child.c,v
retrieving revision 1.16
diff -u -p -r1.16 child.c
--- child.c 18 Apr 2011 12:29:59 -0000 1.16
+++ child.c 9 Jun 2014 18:33:28 -0000
@@ -363,7 +363,6 @@ waitup(void)
CHILD *pc;
fd_set *rchildfdsp = NULL;
int rchildfdsn = 0;
- size_t bytes;
debugmsg(DM_CALL, "waitup() start\n");
@@ -379,11 +378,9 @@ waitup(void)
for (pc = childlist; pc; pc = pc->c_next)
if (pc->c_readfd > rchildfdsn)
rchildfdsn = pc->c_readfd;
- bytes = howmany(rchildfdsn+1, NFDBITS) * sizeof(fd_mask);
- if ((rchildfdsp = (fd_set *)malloc(bytes)) == NULL)
+ if ((rchildfdsp = calloc(howmany(rchildfdsn+1, NFDBITS),
sizeof(fd_mask))) == NULL)
return;
- memset(rchildfdsp, 0, bytes);
for (pc = childlist; pc; pc = pc->c_next)
if (pc->c_readfd > 0) {
debugmsg(DM_MISC, "waitup() select on %d (%s)\n",