diff options
author | Matt Caswell <matt@openssl.org> | 2023-10-13 17:33:31 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-10-23 11:08:22 +0200 |
commit | d8a4451fa76c83ba08b42b38848ba9705fbe71a2 (patch) | |
tree | 9a075b7d856a3dde9f1c921863599e2061bdab73 /ssl | |
parent | Drop FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION for some builds (diff) | |
download | openssl-d8a4451fa76c83ba08b42b38848ba9705fbe71a2.tar.xz openssl-d8a4451fa76c83ba08b42b38848ba9705fbe71a2.zip |
If an error occurs constructing the quic record layer, free it properly
We need to call quic_free() to free the record layer to ensure than any
BIO that was already set is also freed.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22368)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_tls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c index a1bcedbfb0..af4af56c77 100644 --- a/ssl/quic/quic_tls.c +++ b/ssl/quic/quic_tls.c @@ -85,6 +85,7 @@ struct ossl_record_layer_st { }; static int quic_set1_bio(OSSL_RECORD_LAYER *rl, BIO *bio); +static int quic_free(OSSL_RECORD_LAYER *r); static int quic_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, @@ -189,7 +190,7 @@ quic_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers, return 1; err: *retrl = NULL; - OPENSSL_free(rl); + quic_free(rl); return 0; } |