]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: remove two zero assigns after memset clear
authorDaniel Stenberg <daniel@haxx.se>
Thu, 12 Mar 2026 06:59:50 +0000 (07:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 12 Mar 2026 07:47:02 +0000 (08:47 +0100)
As the struct is now always unconditionally memset with zeros, we
can remove two zero assigns.

Follow-up to 015f1c7de40839b6681b7dde7

Pointed out by CodeSonar

Closes #20900

lib/hostip.c

index 135c02b7186ec59d6925c3149c0c44dd5503ce46..65cce061a0411c9e451faf7361cd38398a132173 100644 (file)
@@ -683,10 +683,6 @@ static struct Curl_addrinfo *get_localhost6(int port, const char *name)
   memset(&sa6, 0, sizeof(sa6));
   sa6.sin6_family = AF_INET6;
   sa6.sin6_port = htons(port16);
-  sa6.sin6_flowinfo = 0;
-#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
-  sa6.sin6_scope_id = 0;
-#endif
 
   (void)curlx_inet_pton(AF_INET6, "::1", ipv6);
   memcpy(&sa6.sin6_addr, ipv6, sizeof(ipv6));