malloc calloc patch

git-svn-id: file:///svn/unbound/trunk@3173 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Matthijs Mekking 2014-07-11 15:38:07 +00:00
parent 12137fe970
commit 2669be8beb
2 changed files with 4 additions and 3 deletions

View File

@ -120,12 +120,10 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
{
struct addrinfo *ai;
ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
ai = calloc(1, sizeof(*ai) + sizeof(struct sockaddr_in));
if (ai == NULL)
return (NULL);
memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
ai->ai_addr = (struct sockaddr *)(ai + 1);
/* XXX -- ssh doesn't use sa_len */
ai->ai_addrlen = sizeof(struct sockaddr_in);

View File

@ -1,3 +1,6 @@
11 July 2014: Matthijs
- fake-rfc2553 patch (thanks Benjamin Baier).
11 July 2014: Wouter
- arc4random in compat/ and getentropy, explicit_bzero, chacha for
dependencies, from OpenBSD. arc4_lock and sha512 in compat.