Author: bapt
Date: Fri Jan 18 17:49:00 2013
New Revision: 245609
URL: http://svnweb.freebsd.org/changeset/base/245609

Log:
  MFC: r245412
  Directly uses calloc(3) instread of malloc(3) + memset(3)
  
  Reported by:  Jeremy Chadwick <j...@koitsu.org>

Modified:
  stable/9/usr.sbin/pkg/dns_utils.c
Directory Properties:
  stable/9/usr.sbin/pkg/   (props changed)

Modified: stable/9/usr.sbin/pkg/dns_utils.c
==============================================================================
--- stable/9/usr.sbin/pkg/dns_utils.c   Fri Jan 18 17:48:10 2013        
(r245608)
+++ stable/9/usr.sbin/pkg/dns_utils.c   Fri Jan 18 17:49:00 2013        
(r245609)
@@ -66,10 +66,9 @@ dns_getsrvinfo(const char *zone)
                p += len + NS_QFIXEDSZ;
        }
 
-       res = malloc(sizeof(struct dns_srvinfo) * ancount);
+       res = calloc(ancount, sizeof(struct dns_srvinfo));
        if (res == NULL)
                return (NULL);
-       memset(res, 0, sizeof(struct dns_srvinfo) * ancount);
 
        n = 0;
        while (ancount > 0 && p < end) {
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to