Add OPENSSL_free() to release trace_data if trace_data is not NULL but other errors occur to avoid memory leak.
Fixes: 682b444f8a ("apps/openssl.c: Adapt to enable tracing output")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27911)
OSSL_trace_set_callback(category, NULL, NULL);
BIO_free_all(channel);
+ OPENSSL_free(trace_data);
}
}