summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-01-14 07:17:38 +0000
committerbapt <bapt@FreeBSD.org>2013-01-14 07:17:38 +0000
commita150559b39c68554c3b46f51c3a347efcdbd4f49 (patch)
treea63ad2fccbebeafda8572509e3479db51f8c5208 /usr.sbin/pkg
parent5a71b324fb7db5e1e684b63e0aadd839a7f176be (diff)
downloadFreeBSD-src-a150559b39c68554c3b46f51c3a347efcdbd4f49.zip
FreeBSD-src-a150559b39c68554c3b46f51c3a347efcdbd4f49.tar.gz
Directly uses calloc(3) instread of malloc(3) + memset(3)
Reported by: Jeremy Chadwick <jdc@koitsu.org> MFC after: 3 days
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r--usr.sbin/pkg/dns_utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c
index e88bf98..239be90 100644
--- a/usr.sbin/pkg/dns_utils.c
+++ b/usr.sbin/pkg/dns_utils.c
@@ -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) {
OpenPOWER on IntegriCloud