summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@qlyoung.net>2019-07-03 21:35:54 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-07-03 21:36:48 +0000
commit83d3c097efcc724177fae7b5f8c8daefd95e9a32 (patch)
tree0e0c1202a6554cf06674c5a74bcaf7b693a92afc
parentf5f855c91239706b173e2412cea301f4a3643e2d (diff)
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;