svn commit: r292605 - head/usr.sbin/cron/cron

Pedro F. Giffuni pfg at FreeBSD.org
Tue Dec 22 15:20:09 UTC 2015


Author: pfg
Date: Tue Dec 22 15:20:08 2015
New Revision: 292605
URL: https://svnweb.freebsd.org/changeset/base/292605

Log:
  crontab: replace malloc + bzero with calloc
  
  Obtained from:	OpenBSD (Rev 1.20)

Modified:
  head/usr.sbin/cron/cron/popen.c

Modified: head/usr.sbin/cron/cron/popen.c
==============================================================================
--- head/usr.sbin/cron/cron/popen.c	Tue Dec 22 15:03:45 2015	(r292604)
+++ head/usr.sbin/cron/cron/popen.c	Tue Dec 22 15:20:08 2015	(r292605)
@@ -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);


More information about the svn-src-all mailing list