Remove unnecessary null check before free
This commit is contained in:
parent
f5f855c912
commit
83d3c097ef
2
net.c
2
net.c
@ -435,9 +435,7 @@ addrretry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* For repeat connection */
|
/* For repeat connection */
|
||||||
if (c->saddr) {
|
|
||||||
free(c->saddr);
|
free(c->saddr);
|
||||||
}
|
|
||||||
c->saddr = malloc(p->ai_addrlen);
|
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