crontab: replace malloc + bzero with calloc

Obtained from:	OpenBSD (Rev 1.20)
This commit is contained in:
Pedro F. Giffuni 2015-12-22 15:20:08 +00:00
parent f501e6f136
commit c28c984689
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292605

View file

@ -82,9 +82,8 @@ cron_popen(program, type, e)
if (!pids) {
if ((fds = getdtablesize()) <= 0)
return(NULL);
if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T)))))
if (!(pids = calloc(fds, sizeof(PID_T))))
return(NULL);
bzero((char *)pids, fds * sizeof(PID_T));
}
if (pipe(pdes) < 0)
return(NULL);