Date: Fri, 18 Jan 2013 17:48:11 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r245608 - stable/8/usr.sbin/pkg Message-ID: <201301181748.r0IHmBqI083260@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Fri Jan 18 17:48:10 2013 New Revision: 245608 URL: http://svnweb.freebsd.org/changeset/base/245608 Log: MFC: r245412 Directly uses calloc(3) instread of malloc(3) + memset(3) Reported by: Jeremy Chadwick <jdc@koitsu.org> Modified: stable/8/usr.sbin/pkg/dns_utils.c Directory Properties: stable/8/usr.sbin/pkg/ (props changed) Modified: stable/8/usr.sbin/pkg/dns_utils.c ============================================================================== --- stable/8/usr.sbin/pkg/dns_utils.c Fri Jan 18 16:32:33 2013 (r245607) +++ stable/8/usr.sbin/pkg/dns_utils.c Fri Jan 18 17:48:10 2013 (r245608) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301181748.r0IHmBqI083260>