From 83d3c097efcc724177fae7b5f8c8daefd95e9a32 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 3 Jul 2019 21:35:54 +0000 Subject: [PATCH] Remove unnecessary null check before free --- net.c | 4 +--- 1 file changed, 1 insertion(+), 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;