summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-10-13 16:33:31 +0100
committerMatt Caswell <matt@openssl.org>2023-10-23 10:08:22 +0100
commitd8a4451fa76c83ba08b42b38848ba9705fbe71a2 (patch)
tree9a075b7d856a3dde9f1c921863599e2061bdab73 /ssl
parentd8bf5ea19d388028004f06f2ffcd40dbd80c1845 (diff)
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.c3
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;
}