]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
altsvc: minimize variable scope and avoid "DEAD_STORE"
authorDaniel Stenberg <daniel@haxx.se>
Sat, 7 Nov 2020 13:17:53 +0000 (14:17 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 7 Nov 2020 17:10:21 +0000 (18:10 +0100)
Closes #6182

lib/altsvc.c

index 6a2a5f57bc9bce80a05d98980b6eefd2d39d9b52..4ab77fdfc89c22368ea364ffbc1d4344f6f061c4 100644 (file)
@@ -451,7 +451,6 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
 {
   const char *p = value;
   size_t len;
-  enum alpnid dstalpnid = srcalpnid; /* the same by default */
   char namebuf[MAX_ALTSVC_HOSTLEN] = "";
   char alpnbuf[MAX_ALTSVC_ALPNLEN] = "";
   struct altsvc *as;
@@ -478,7 +477,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
   do {
     if(*p == '=') {
       /* [protocol]="[host][:port]" */
-      dstalpnid = alpn2alpnid(alpnbuf);
+      enum alpnid dstalpnid = alpn2alpnid(alpnbuf); /* the same by default */
       p++;
       if(*p == '\"') {
         const char *dsthost = "";