]> 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:12 +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)

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

index 823f1165a3ff876fbfe92eb6ae71728cbf1fc2b9..0f74e5493421df3fb3b2a5e0005c8f989c8c5bdd 100644 (file)
@@ -911,8 +911,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)) {
@@ -1042,6 +1040,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]);