diff options
author | bapt <bapt@FreeBSD.org> | 2013-01-14 07:17:38 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2013-01-14 07:17:38 +0000 |
commit | a150559b39c68554c3b46f51c3a347efcdbd4f49 (patch) | |
tree | a63ad2fccbebeafda8572509e3479db51f8c5208 /usr.sbin/pkg | |
parent | 5a71b324fb7db5e1e684b63e0aadd839a7f176be (diff) | |
download | FreeBSD-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.c | 3 |
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) { |