diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-23 12:42:57 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-23 12:42:57 +0300 |
commit | ec2e54b2c075f30e9499adea22681499e3f6582d (patch) | |
tree | eead84bdf1f41b78f90f00c13e02dd59eae92133 /missing_d/getaddrinfo.c | |
parent | 9ccddb999bb2d79c261702f789deb9371090a4ec (diff) | |
parent | 44e29458a6355ad64e8d89676a441b224ce76cbc (diff) | |
download | egawk-ec2e54b2c075f30e9499adea22681499e3f6582d.tar.gz egawk-ec2e54b2c075f30e9499adea22681499e3f6582d.tar.bz2 egawk-ec2e54b2c075f30e9499adea22681499e3f6582d.zip |
Merge branch 'master' into feature/api-mpfr
Diffstat (limited to 'missing_d/getaddrinfo.c')
-rw-r--r-- | missing_d/getaddrinfo.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/missing_d/getaddrinfo.c b/missing_d/getaddrinfo.c index f24ac598..5233cf56 100644 --- a/missing_d/getaddrinfo.c +++ b/missing_d/getaddrinfo.c @@ -33,12 +33,11 @@ getaddrinfo(const char *hostname, const char *portname, if (res == NULL) return EINVAL; - out = (struct addrinfo *) malloc(sizeof(*out)); + out = (struct addrinfo *) calloc(1, sizeof(*out)); if (out == NULL) { *res = NULL; return ENOMEM; } - memset(out, '\0', sizeof(*out)); out->ai_addr = (struct sockaddr *) malloc(sizeof(struct sockaddr_in)); if (out->ai_addr == NULL) { |