]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vquic: make vquic_send_packets not return without setting psent
authorDaniel Stenberg <daniel@haxx.se>
Sun, 22 Dec 2024 23:01:12 +0000 (00:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 Dec 2024 07:29:52 +0000 (08:29 +0100)
This is debug code, but since the caller might use the value even when
this function returns error, it needs to be cleared properly here.

Spotted by Clang-tidy

Closes #15807

lib/vquic/vquic.c

index 41a2cc9757210142bdf2d1669183c70e172af85e..09708915804cf96bfc772345a01f00343e897e90 100644 (file)
@@ -248,6 +248,7 @@ static CURLcode vquic_send_packets(struct Curl_cfilter *cf,
   /* simulate network blocking/partial writes */
   if(qctx->wblock_percent > 0) {
     unsigned char c;
+    *psent = 0;
     Curl_rand(data, &c, 1);
     if(c >= ((100-qctx->wblock_percent)*256/100)) {
       CURL_TRC_CF(data, cf, "vquic_flush() simulate EWOULDBLOCK");