summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nunberg <mnunberg@users.noreply.github.com>2019-08-09 03:40:32 -0400
committerGitHub <noreply@github.com>2019-08-09 03:40:32 -0400
commitfbb83c4a7a290d6ff912a6e77dd2ad6dfac357af (patch)
treea738a1c2fa48cd454cff6cdee9b257260c58e9e1
parent9414207002771d2caea82f2711e19ae4f541f155 (diff)
parent83d3c097efcc724177fae7b5f8c8daefd95e9a32 (diff)
Merge pull request #684 from qlyoung/remove-unnecessary-nullcheck
Remove unnecessary null check before free
-rw-r--r--net.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net.c b/net.c
index ac304b4..255f435 100644
--- a/net.c
+++ b/net.c
@@ -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;