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/?a=commitdiff_plain;h=13259a758ada910aec10313cd063ce54dacfc4a5;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) --- 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 823f1165a3f..0f74e549342 100644 --- a/test/quic-openssl-docker/hq-interop/quic-hq-interop.c +++ b/test/quic-openssl-docker/hq-interop/quic-hq-interop.c @@ -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]);