Unverified Commit fbb83c4a authored by Mark Nunberg's avatar Mark Nunberg Committed by GitHub
Browse files

Merge pull request #684 from qlyoung/remove-unnecessary-nullcheck

Remove unnecessary null check before free
parents 94142070 83d3c097
...@@ -435,9 +435,7 @@ addrretry: ...@@ -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;
......
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