]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/quic-openssl-docker/hq-interop/quic-hq-interop.c: Move BIO_free() to err label...
authorJiasheng Jiang <jiashengjiangcool@gmail.com>
Tue, 8 Jul 2025 23:18:43 +0000 (23:18 +0000)
committerNeil Horman <nhorman@openssl.org>
Thu, 10 Jul 2025 12:03:50 +0000 (08:03 -0400)
Relocate the BIO_free() call to the 'err' label to ensure the memory is properly freed in case of an error.

Fixes: ec6200bf0f ("Move hq-interop code to test/quic-openssl-docker")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27995)

(cherry picked from commit 13259a758ada910aec10313cd063ce54dacfc4a5)

test/quic-openssl-docker/hq-interop/quic-hq-interop.c

index 14375d178a77b3cfd98efd03ecac81b6a6e314b9..80b93c68c91ee2c61582935d20bc1941c0b39c90 100644 (file)
@@ -906,8 +906,6 @@ int main(int argc, char *argv[])
             goto end;
         }
     }
-    BIO_free(req_bio);
-    req_bio = NULL;
     reqnames[read_offset + 1] = '\0';
 
     if (!setup_connection(hostname, port, &ctx, &ssl)) {
@@ -1037,6 +1035,7 @@ int main(int argc, char *argv[])
      */
     BIO_ADDR_free(peer_addr);
     OPENSSL_free(reqnames);
+    BIO_free(req_bio);
     BIO_free(session_bio);
     for (poll_idx = 0; poll_idx < poll_count; poll_idx++) {
         BIO_free(outbiolist[poll_idx]);