]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ngtcp2: assigning timeout, but value is overwritten before used
authorDaniel Stenberg <daniel@haxx.se>
Mon, 17 Jul 2023 18:23:22 +0000 (20:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 17 Jul 2023 19:02:56 +0000 (21:02 +0200)
Reported by Coverity

Closes #11453

lib/vquic/curl_ngtcp2.c

index 5db9df57ac7cbafde07f91c0418036dcc31a5a6c..1d68fc0f1a27b6809ab7e6d85c6ff2b3057ab5d6 100644 (file)
@@ -1000,7 +1000,6 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf,
   struct cf_ngtcp2_ctx *ctx = cf->ctx;
   struct pkt_io_ctx local_pktx;
   ngtcp2_tstamp expiry;
-  ngtcp2_duration timeout;
 
   if(!pktx) {
     pktx_init(&local_pktx, cf, data);
@@ -1021,7 +1020,6 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf,
         ngtcp2_ccerr_set_liberr(&ctx->last_error, rv, NULL, 0);
         return CURLE_SEND_ERROR;
       }
-      timeout = 0;
       result = cf_progress_ingress(cf, data, pktx);
       if(result)
         return result;
@@ -1033,7 +1031,7 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf,
     }
 
     if(expiry > pktx->ts) {
-      timeout = expiry - pktx->ts;
+      ngtcp2_duration timeout = expiry - pktx->ts;
       if(timeout % NGTCP2_MILLISECONDS) {
         timeout += NGTCP2_MILLISECONDS;
       }