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 | |
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')
-rw-r--r-- | missing_d/ChangeLog | 4 | ||||
-rw-r--r-- | missing_d/getaddrinfo.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog index 83f5b93e..7d9bddc4 100644 --- a/missing_d/ChangeLog +++ b/missing_d/ChangeLog @@ -1,3 +1,7 @@ +2017-06-21 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * getaddrinfo.c (getaddrinfo): Replace malloc+memset with calloc. + 2016-10-23 Arnold D. Robbins <arnold@skeeve.com> * General: Remove trailing whitespace from all relevant files. 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) { |