diff --git a/crypto/trace.c b/crypto/trace.c index 51387641de948c..3e10d91fc26386 100644 --- a/crypto/trace.c +++ b/crypto/trace.c @@ -475,7 +475,7 @@ BIO *OSSL_trace_begin(int category) char *prefix = NULL; category = ossl_trace_get_category(category); - if (category < 0) + if (category < 0 || !OSSL_trace_enabled(category)) return NULL; channel = trace_channels[category].bio;