saddr should be addrlen bytes
Not sizeof saddr.
This commit is contained in:
parent
49974c9359
commit
5e6bbf8c60
2
net.c
2
net.c
@ -402,7 +402,7 @@ addrretry:
|
|||||||
if (c->saddr) {
|
if (c->saddr) {
|
||||||
free(c->saddr);
|
free(c->saddr);
|
||||||
}
|
}
|
||||||
c->saddr = malloc(sizeof(*p->ai_addr));
|
c->saddr = malloc(p->ai_addrlen);
|
||||||
memcpy(c->saddr, p->ai_addr, p->ai_addrlen);
|
memcpy(c->saddr, p->ai_addr, p->ai_addrlen);
|
||||||
c->addrlen = p->ai_addrlen;
|
c->addrlen = p->ai_addrlen;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user