From: Jiasheng Jiang Date: Tue, 8 Jul 2025 23:18:43 +0000 (+0000) Subject: test/quic-openssl-docker/hq-interop/quic-hq-interop.c: Move BIO_free() to err label... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbcd48562199104209ffc77f5deb35ad2089c9a1;p=thirdparty%2Fopenssl.git test/quic-openssl-docker/hq-interop/quic-hq-interop.c: Move BIO_free() to err label to avoid memory leak 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 Reviewed-by: Neil Horman Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/27995) (cherry picked from commit 13259a758ada910aec10313cd063ce54dacfc4a5) --- diff --git a/test/quic-openssl-docker/hq-interop/quic-hq-interop.c b/test/quic-openssl-docker/hq-interop/quic-hq-interop.c index 14375d178a7..80b93c68c91 100644 --- a/test/quic-openssl-docker/hq-interop/quic-hq-interop.c +++ b/test/quic-openssl-docker/hq-interop/quic-hq-interop.c @@ -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]);