summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 12:35:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 12:35:39 -0700
commit9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (patch)
treef52f20367d13f2078fe6199e230322c899b9308d /compat
parentNinth batch for 2.1 (diff)
parentuse xmemdupz() to allocate copies of strings given by start and length (diff)
downloadtgif-9ab08822556c49a7856dadd0e9a42f9ec2aaf850.tar.xz
Merge branch 'maint'
* maint: use xmemdupz() to allocate copies of strings given by start and length use xcalloc() to allocate zero-initialized memory
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index c19e3d954b..9d435e2cf4 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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