Directly uses calloc(3) instread of malloc(3) + memset(3)
Reported by: Jeremy Chadwick <jdc@koitsu.org> MFC after: 3 days
This commit is contained in:
parent
10b4bb0b33
commit
8cc0ef19d2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user