mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 02:06:37 +00:00
crontab: replace malloc + bzero with calloc
Obtained from: OpenBSD (Rev 1.20)
This commit is contained in:
parent
f501e6f136
commit
c28c984689
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292605
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue