Remove unnecessary null check before free

This commit is contained in:
Quentin Young 2019-07-03 21:35:54 +00:00 committed by Quentin Young
parent f5f855c912
commit 83d3c097ef

4
net.c
View File

@ -435,9 +435,7 @@ addrretry:
}
/* For repeat connection */
if (c->saddr) {
free(c->saddr);
}
free(c->saddr);
c->saddr = malloc(p->ai_addrlen);
memcpy(c->saddr, p->ai_addr, p->ai_addrlen);
c->addrlen = p->ai_addrlen;