Merge branch 'maint'

* maint:
  use xmemdupz() to allocate copies of strings given by start and length
  use xcalloc() to allocate zero-initialized memory
This commit is contained in:
Junio C Hamano
2014-07-21 12:35:39 -07:00
10 changed files with 10 additions and 27 deletions

View File

@ -1316,8 +1316,7 @@ static int WSAAPI getaddrinfo_stub(const char *node, const char *service,
else
ai->ai_canonname = NULL;
sin = xmalloc(ai->ai_addrlen);
memset(sin, 0, ai->ai_addrlen);
sin = xcalloc(1, ai->ai_addrlen);
sin->sin_family = AF_INET;
/* Note: getaddrinfo is supposed to allow service to be a string,
* which should be looked up using getservbyname. This is