From: JiashengJiang Date: Mon, 12 May 2025 14:02:05 +0000 (-0400) Subject: test/testutil/testutil_init.c: Add OPENSSL_free() to avoid memory leak X-Git-Tag: openssl-3.4.2~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab4e07c3e6a1df930dafbc96d126bb19939f7f6;p=thirdparty%2Fopenssl.git test/testutil/testutil_init.c: Add OPENSSL_free() to avoid memory leak Free trace_data if error occurs to avoid memory leak. Fixes: d73458d17a ("Add tracing capability in test utilities") Signed-off-by: JiashengJiang Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27600) (cherry picked from commit 3818f7779ef4bf4d4ccacd13506ec92885e45553) --- diff --git a/test/testutil/testutil_init.c b/test/testutil/testutil_init.c index 3301551ab2f..69ea27ed2b9 100644 --- a/test/testutil/testutil_init.c +++ b/test/testutil/testutil_init.c @@ -92,6 +92,7 @@ static void setup_trace_category(int category) "warning: unable to setup trace callback for category '%s'.\n", OSSL_trace_get_category_name(category)); + OPENSSL_free(trace_data); OSSL_trace_set_callback(category, NULL, NULL); BIO_free_all(channel); }