diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2006-04-03 01:31:12 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2006-04-03 01:31:12 +0000 |
commit | e18f913a64d2f5ecd13ffdfd8add7ca9bbb93e94 (patch) | |
tree | 062e820797b1dc01d497d48f824767b3143fb530 /usr.sbin/cron | |
parent | 3528f180d3ebcd8412d900eea8a18ca2e4f799aa (diff) |
some more malloc(x * y); bzero() -> calloc(x, y) whacking from
adobriyan AT gmail.com
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r-- | usr.sbin/cron/popen.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/cron/popen.c b/usr.sbin/cron/popen.c index 62c3c569ff8..f02c2bb36ba 100644 --- a/usr.sbin/cron/popen.c +++ b/usr.sbin/cron/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.19 2003/06/02 04:39:45 millert Exp $ */ +/* $OpenBSD: popen.c,v 1.20 2006/04/03 01:31:11 djm Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -41,7 +41,7 @@ #if 0 static const sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94"; #else -static const char rcsid[] = "$OpenBSD: popen.c,v 1.19 2003/06/02 04:39:45 millert Exp $"; +static const char rcsid[] = "$OpenBSD: popen.c,v 1.20 2006/04/03 01:31:11 djm Exp $"; #endif #endif /* not lint */ @@ -72,9 +72,8 @@ cron_popen(char *program, char *type, struct passwd *pw) { if (!pids) { if ((fds = sysconf(_SC_OPEN_MAX)) <= 0) return (NULL); - if (!(pids = (PID_T *)malloc((size_t)(fds * sizeof(PID_T))))) + if (!(pids = calloc(fds, sizeof(PID_T)))) return (NULL); - bzero(pids, fds * sizeof(PID_T)); } if (pipe(pdes) < 0) return (NULL); |