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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to