1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 08:38:49 -05:00

altsvc: minimize variable scope and avoid "DEAD_STORE"

Closes #6182
This commit is contained in:
Daniel Stenberg 2020-11-07 14:17:53 +01:00
parent 65bc682524
commit 5d903ce3a3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

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