summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg/dns_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg/dns_utils.c')
-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