diff src/event/ngx_event_quic.c @ 7871:df18ae7161b8 quic

Assorted fixes. Found by Clang Static Analyzer.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 20 May 2020 15:36:24 +0300
parents e169cce912c7
children 1245e274b9ba
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -1081,6 +1081,7 @@ ngx_quic_input_handler(ngx_event_t *rev)
     ngx_quic_connection_t  *qc;
     static u_char           buf[NGX_QUIC_DEFAULT_MAX_PACKET_SIZE];
 
+    ngx_memzero(&b, sizeof(ngx_buf_t));
     b.start = buf;
     b.end = buf + sizeof(buf);
     b.pos = b.last = b.start;
@@ -1438,8 +1439,6 @@ ngx_quic_retry_input(ngx_connection_t *c
 
     c->log->action = "retrying quic connection";
 
-    qc = c->quic;
-
     if (ngx_buf_size(pkt->raw) < NGX_QUIC_MIN_INITIAL_SIZE) {
         ngx_log_error(NGX_LOG_INFO, c->log, 0,
                       "quic UDP datagram is too small for initial packet");
@@ -3243,7 +3242,6 @@ ngx_quic_retransmit(ngx_connection_t *c,
     qc = c->quic;
 
     now = ngx_current_msec;
-    wait = 0;
 
     if (ngx_queue_empty(&ctx->sent)) {
         *waitp = 0;
@@ -3949,6 +3947,7 @@ ngx_quic_free_frame(ngx_connection_t *c,
 
     if (frame->data) {
         ngx_free(frame->data);
+        frame->data = NULL;
     }
 
     ngx_queue_insert_head(&qc->free_frames, &frame->queue);