diff options
author | pfg <pfg@FreeBSD.org> | 2015-12-22 15:20:08 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2015-12-22 15:20:08 +0000 |
commit | 43a39d413b3d6364a0b4e6b8a46ebb84ce81f14e (patch) | |
tree | 8824cc02336207c97b2e9004bbbf07eb13cfe942 /usr.sbin | |
parent | d5983c09f167dff2938da5c7a184ad370d380aca (diff) | |
download | FreeBSD-src-43a39d413b3d6364a0b4e6b8a46ebb84ce81f14e.zip FreeBSD-src-43a39d413b3d6364a0b4e6b8a46ebb84ce81f14e.tar.gz |
crontab: replace malloc + bzero with calloc
Obtained from: OpenBSD (Rev 1.20)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/cron/popen.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/cron/cron/popen.c b/usr.sbin/cron/cron/popen.c index 428de2e..57b1f77 100644 --- a/usr.sbin/cron/cron/popen.c +++ b/usr.sbin/cron/cron/popen.c @@ -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); |