summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-12-22 15:20:08 +0000
committerpfg <pfg@FreeBSD.org>2015-12-22 15:20:08 +0000
commit43a39d413b3d6364a0b4e6b8a46ebb84ce81f14e (patch)
tree8824cc02336207c97b2e9004bbbf07eb13cfe942 /usr.sbin
parentd5983c09f167dff2938da5c7a184ad370d380aca (diff)
downloadFreeBSD-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.c3
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);
OpenPOWER on IntegriCloud