Commit dbee6835 by Edward Thomson

Merge pull request #3567 from sba1/few-p_getaddrinfo-fixes

Few p_getaddrinfo fixes
parents 1a9d7c95 9f9df4b6
......@@ -62,8 +62,11 @@ int p_getaddrinfo(
ai = ainfo;
for (p = 1; ainfo->ai_hostent->h_addr_list[p] != NULL; p++) {
ai->ai_next = malloc(sizeof(struct addrinfo));
memcpy(&ai->ai_next, ainfo, sizeof(struct addrinfo));
if (!(ai->ai_next = malloc(sizeof(struct addrinfo)))) {
p_freeaddrinfo(ainfo);
return -1;
}
memcpy(ai->ai_next, ainfo, sizeof(struct addrinfo));
memcpy(&ai->ai_next->ai_addr_in.sin_addr,
ainfo->ai_hostent->h_addr_list[p],
ainfo->ai_hostent->h_length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment