diff options
author | yuanjungong <yuanjungong96@gmail.com> | 2021-09-01 11:33:34 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-10-22 11:57:13 +0200 |
commit | d49d1c120dac5349df0bb36960bc914e211368bd (patch) | |
tree | 2a3bc153fa7018c21d7dcab1d805203053ececb6 /apps | |
parent | d641ad51326e96b41f0490e2e3398d08e8f87557 (diff) |
Clean up on failed BIO creation
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16316)
(cherry picked from commit f11c01a666e9d5b97e859cbc74586802549dee00)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/openssl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index 2693350ffc..e20661277e 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -168,14 +168,17 @@ static void setup_trace_category(int category) { BIO *channel; tracedata *trace_data; + BIO *bio = NULL; if (OSSL_trace_enabled(category)) return; - channel = BIO_push(BIO_new(BIO_f_prefix()), dup_bio_err(FORMAT_TEXT)); + bio = BIO_new(BIO_f_prefix()); + channel = BIO_push(bio, dup_bio_err(FORMAT_TEXT)); trace_data = OPENSSL_zalloc(sizeof(*trace_data)); if (trace_data == NULL + || bio == NULL || (trace_data->bio = channel) == NULL || OSSL_trace_set_callback(category, internal_trace_cb, trace_data) == 0 |